GDL
About building parametric objects with GDL.
SOLVED!

About the line drawn by the label GDL

Nami Furuta
Booster

I want to draw an "X" mark for an elevation opening on the label GDL.

 

ADD2 LABEL_POSITION [2] [1] + LABEL_POSITION [3] [1], LABEL_POSITION [2] [2] + LABEL_POSITION [3] [2]

LINE2 0,0, OPENING_WIDTH, OPENING_HEIGHT
LINE2 0, OPENING_HEIGHT, OPENING_WIDTH, 0


In the case of the above command, clicking the red circle of the opening will place it neatly, but I also want to place the "X" mark in the opening by clicking any of the other (blue circles).
How can I place the "X" mark regardless of the click position of the label placement?


LABEL.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Thank you Barry.

 

I will make a GDL based on the GDL that you sent me.

Thank you

View solution in original post

8 REPLIES 8
DGSketcher
Legend

@Nami Furuta You will need to create a Parameter which can be set manually in the label and then use a gosub routine to draw lines based on the Parameter value. So if the Parameter value was say 5 for centre you would then draw lines...

Line2 -opening_width/2, -opening_height/2, opening_width/2, opening_height/2

Line2 -opening_width/2,  opening_height/2, opening_width/2, -opening_height/2

 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Thank you, @DGSketcher.

 

I understand that I'm adding a parameter to the label GDL.

 

I don't know after that. Excuse me, but please tell me a little more.

Do you make the process of drawing a line a subroutine?

 

I don't know much about GDL.

@Nami Furuta You will need a subroutine for each of the potential nine connection points. Lets call the Parameter "insPt". Your code would then have a series of IF's...

 

In the Parameter Script add Values "insPt" 1, 2, 3, etc

 

In the 2D script add links to the subroutines with the required Line2 entries

 

if insPt = 1 then gosub "insLL"

if insPt = 3 then gosub "insRR"

if insPt = 5 then gosub "insCTR"

etc 

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)

Thank you, @DGSketcher

 

Add a parameter to the label GDL and specify the place to insert the label (1or2or3or ...) in the parameter.

 

In the 2D script of the label GDL, prepare the code according to the value of the parameter.

Do not place labels based on the position clicked with the mouse. Instead, the label is placed from the value set in the parameter.

 

Is it correct?

Barry Kelly
Moderator

@Nami Furuta ,

A present for you.😀

I just quickly altered a label I had that had a nice visual anchor point picker.

Only active when you don't use the label leader line.

It may not be perfect but should give you some ideas.

 

The image for that anchor point should be in your default library.

If you don't see this then let me know and I will hunt down the image.

 

BarryKelly_0-1652779533117.png

 

Barry.

 

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11

Thank you Barry.

 

The image file is displayed.
I'll try, but it's difficult for me. .. ..

 

The content will change, but ...

 

The parameter of the label GDL has the center coordinates (*) of the opening additionally.
* Setting a value for this parameter will be set with the API I create.

 

However, the center coordinates of the opening are global coordinates.
Is it possible to draw an "X" mark at the position of this global coordinate in the script of the label GDL?

I want to draw the X "mark with the script of the label GDL.

 

If you can't draw an X "mark at the global coordinate position of the center of the opening in the label GDL script, use the method advised by DG Sketcher and Berry (specify the GDL insertion position in the label parameter). I will adopt it.

 

Thank you.

You now mention API.

That is a different kettle of fish and not something I know anything about.

 

The label that I posted here is not actually reading the size from the element you are labelling.

However that can be done with ... n = REQUEST ("ASSOCLP_PARVALUE", expr, name_or_index, type, flags, dim1, dim2, p_values)

 

I don't think you can get the global position of an opening in GDL.

Only the SYMB_POS_X (/Y/Z) which is the position from the start of the wall it is in.

 

If you are doing this for openings (as in the opening tool - not doors or windows), they have their own 2D symbols that can be used rather than placing a label.

 

Barry.

One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Solution

Thank you Barry.

 

I will make a GDL based on the GDL that you sent me.

Thank you