I want to draw an "X" mark for an elevation opening on the label GDL.
ADD2 LABEL_POSITION   + LABEL_POSITION  , LABEL_POSITION   + LABEL_POSITION  
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?
Solved! Go to Solution.
@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
@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"
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?
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.
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.
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.