2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations
2022-05-17
06:52 AM
- last edited on
2023-05-31
10:06 AM
by
Laszlo Simon
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?
Solved! Go to Solution.
2022-05-18 08:59 AM
Thank you Barry.
I will make a GDL based on the GDL that you sent me.
Thank you
2022-05-17 09:25 AM
@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
2022-05-17 09:39 AM
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.
2022-05-17 10:15 AM
@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
2022-05-17 10:34 AM
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?
2022-05-17 11:27 AM - edited 2022-05-17 11:28 AM
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.
Barry.
2022-05-18 04:46 AM - edited 2022-05-18 04:52 AM
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.
2022-05-18 05:37 AM
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.
2022-05-18 08:59 AM
Thank you Barry.
I will make a GDL based on the GDL that you sent me.
Thank you