Wishes
Post your wishes about Graphisoft products: Archicad, BIMx, BIMcloud, and DDScad.
SOLVED!

Grid Elements

gdford
Advisor
There are times when grid element label heads do not fit on the drawings and thus get trimmed off... I know we can create additional drawings on the layout that only show the grid element heads that we need and then align it manually with the drawing on the layout that has the grid element heads trimmed off...... but it would be nice is we could drill down to the grid element name and display it using autotext in the model and not have to worry about coordinating the grid line names on the layout..... the same is true for story id, names and elevations.

Personally i think that all information in any object should be available using autotext... Story markers are a good example of this... Instead of increasing the flexibility of what the story marker can display, just give me access to the marker data so i can display it how i want.... where's the bim?

Thanks,
GaryF
Gary Ford
Self Employed - Modeling, Estimating, Construction
Archicad 12-26
AMD Ryzen 9 5900X 12-Core Processor
3701 Mhz, 12 Core(s), 24 Logical Processor(s)
(RAM) 128 GB
NVIDIA RTX A2000
24 REPLIES 24
Anonymous
Not applicable
Hi Podolsky,

I am sorry if I may have overstepped in your initiative. I was just trying to help and contribute.

Podolsky wrote:
From where AC_LineType is coming from?
I just opened the "Standard Grid Marker" and copied it before the POLY2_B. It seems that if the pointer is activated, it was passing the line definition to the POLY2_B.

Podolsky wrote:
And what else? Original file was created in GDL version 37 (ArchiCAD 21). You saved in version 41.
My bad. I don't have AC21. If you prefer I will just post the code.

Podolsky wrote:
Where support for square, pentagon and another shapes, as soon as you state you included another wishes?
Something I do not understand here.
ejrolon wrote:
Only wish if possible is to have different line types for the Bubble and the Pointer and to have Text always be horizontal.
If I understand Eduardo correctly, he was referring to that wrong line type when the pointer was activated.
Regarding the text orientation: I didn't do anything as I think it was/is already working.
But I agree that the Marker Shape support is necessary. If you want I can give it a try.
Anonymous
Not applicable

Here is a first try for the marker shape.
2d Script

 

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

HOTSPOT2 0,0, 1

r=REQUEST('View_Rotangle', '', angleViewRotation)
angleTotalRotation=angleViewRotation MOD 360

ROT2 -angleTotalRotation

r=REQUEST ('ASSOCLP_NAME', '', nameObject)
IF nameObject='' THEN 
	textThis='Label unlinked! Select gridline.'
	GOSUB 'WARNING'
	END
ENDIF
IF nameObject<>'Standard grid marker' THEN 
	textThis='Link label only to gridline!'
	GOSUB 'WARNING'
	END
ENDIF

r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerSize', index, type, flags, dim1, dim2, AC_MarkerSize)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerPen', index, type, flags, dim1, dim2, AC_MarkerPen)
r=REQUEST('ASSOCLP_PARVALUE', 'res_mark', index, type, flags, dim1, dim2, res_mark)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextFont_1', index, type, flags, dim1, dim2, AC_TextFont_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextSize_1', index, type, flags, dim1, dim2, AC_TextSize_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextStyle_1', index, type, flags, dim1, dim2, AC_TextStyle_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextPen_1', index, type, flags, dim1, dim2, AC_TextPen_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerText_1', index, type, flags, dim1, dim2, AC_MarkerText_1)
r=REQUEST('ASSOCLP_PARVALUE', 'shBackgroundFill', index, type, flags, dim1, dim2,shBackgroundFill)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_fill_type', index, type, flags, dim1, dim2, gs_fill_type)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_fill_pen', index, type, flags, dim1, dim2, gs_fill_pen)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_back_pen', index, type, flags, dim1, dim2, gs_back_pen)

Marker_Diameter = GLOB_SCALE/1000*AC_MarkerSize

DEFINE STYLE 'TEXT' AC_TextFont_1, AC_TextSize_1, 5, AC_TextStyle_1
SET STYLE 'TEXT'

PEN AC_TextPen_1
Gridline_Number=AC_MarkerText_1
rot2 -LABEL_ROTANGLE
TEXT2 0,0, Gridline_Number
DEL 2

PEN AC_MarkerPen
SET LINE_TYPE AC_LineType

IF shBackgroundFill THEN SET FILL gs_fill_type

if AC_MarkerType_i = 1 then
	if not(shBackgroundFill) then
		circle2 0 , 0 , Marker_Diameter/2
	else
		poly2_b 2, 1+2+4+64, gs_fill_pen, gs_back_pen,
				0, 0, 901,
				Marker_Diameter/2, 360, 4001
	endif
else
	alfa_m2=360/res_mark
	dy=Marker_Diameter/2-Marker_Diameter/2*cos(alfa_m2/2)

	if AC_Type_i = i_Arc then rot2 90

	for m = 1 to res_mark+1
		PUT (Marker_Diameter/2)*cos(alfa_m2*m), (Marker_Diameter/2)*sin(alfa_m2*m), 1
	next m

	poly2_b res_mark+1, 1+2*shBackgroundFill+4+64*shBackgroundFill, gs_fill_pen, gs_back_pen,
		GET (NSP)

	if AC_Type_i = i_Arc then del 1
endif

END

'WARNING':

DEFINE STYLE 'WARNING' Arial, 2.5, 5, 0

SET STYLE 'WARNING'

TEXT2 0, 0, textThis

X1	=STW(textThis)/2000*GLOB_SCALE
Y1	=4.5/2000*GLOB_SCALE

POLY2_B 5, 2, 0, 0,
	X1, Y1, 1,
	X1, -Y1, 1,
	-X1, -Y1, 1,
	-X1, Y1, 1,
	X1, Y1, 1		

RETURN
Eduardo Rolon
Moderator
What I was asking for was that the Label mimic the Grid in order to be able to substitute it when necessary and have everything linked
For this we should have the Label match all the grid settings or have settings that can:
1. Specify Head pen and line type
2. Rotate Head Text or rotate the Leader or just have a setting fo keep the text always horizontal
3. Specify Leader pen and line type
----
Braza's has all but the horizontal text option which I really don't know if it is possible or not.
Eduardo Rolón AIA NCARB
AC27 US/INT -> AC08

Macbook Pro M1 Max 64GB ram, OS X 10.XX latest
another Moderator

Anonymous
Not applicable
Ok Eduardo. I got it.
Check the code in my last post. I added a rot2 -LABEL_ROTANGLE that I think is working as you want.
So. If you want it to mimic the grid line, would you prefer to get grid line type automatically?
Podolsky
Ace
I think mistake that you are doing - before use variables from Standard Grid Marker, they needed to be requested from the object. And these requests I don't see.

Check it again.

In general I'm happy that you modifying my label. Go ahead, make it perfect. It's better to get ArchiCAD 21 (you can download it from Graphisoft web-site) and publish it in version 37. Because the earlier version it is - the more potentially users can use it (as not anyone on the latest version).

Don't forget to upload the final label on BIM components.
Anonymous
Not applicable
You are correct Podolsky. The AC_LineType wasn't reading anything. It was just setting Line_Type to 1 (As there was no AC_LineType defined). But without this definition, the label was pulling the Line_Type from the Grid Marker. I think. So I will just set it to 1.
I also put most of the requests on the Master Script. With this, the label can read the Grid Marker and assign the same line type and pen to the pointer. It seems to be working... If I leave them on 2d it wont work. Do you see any problem with this?

I can't save it to AC21, so I will just post the code and people copy paste it on your original label.
Here is the updated 2d script:
ADD2 LABEL_POSITION[2][1]+LABEL_POSITION[3][1], LABEL_POSITION[3][2]

HOTSPOT2 0,0, 1

r=REQUEST('View_Rotangle', '', angleViewRotation)
angleTotalRotation=angleViewRotation MOD 360

ROT2 -angleTotalRotation

r=REQUEST ('ASSOCLP_NAME', '', nameObject)
IF nameObject='' THEN 
	textThis='Label unlinked! Select gridline.'
	GOSUB 'WARNING'
	END
ENDIF
IF nameObject<>'Standard grid marker' THEN 
	textThis='Link label only to gridline!'
	GOSUB 'WARNING'
	END
ENDIF



Marker_Diameter = GLOB_SCALE/1000*AC_MarkerSize

DEFINE STYLE 'TEXT' AC_TextFont_1, AC_TextSize_1, 5, AC_TextStyle_1
SET STYLE 'TEXT'

PEN AC_TextPen_1
Gridline_Number=AC_MarkerText_1
rot2 -LABEL_ROTANGLE
TEXT2 0,0, Gridline_Number
DEL 2

PEN AC_MarkerPen
SET LINE_TYPE 1

IF shBackgroundFill THEN SET FILL gs_fill_type

if AC_MarkerType_i = 1 then
	if not(shBackgroundFill) then
		circle2 0 , 0 , Marker_Diameter/2
	else
		poly2_b 2, 1+2+4+64, gs_fill_pen, gs_back_pen,
				0, 0, 901,
				Marker_Diameter/2, 360, 4001
	endif
else
	alfa_m2=360/res_mark
	dy=Marker_Diameter/2-Marker_Diameter/2*cos(alfa_m2/2)

	if AC_Type_i = i_Arc then rot2 90

	for m = 1 to res_mark+1
		PUT (Marker_Diameter/2)*cos(alfa_m2*m), (Marker_Diameter/2)*sin(alfa_m2*m), 1
	next m

	poly2_b res_mark+1, 1+2*shBackgroundFill+4+64*shBackgroundFill, gs_fill_pen, gs_back_pen,
		GET (NSP)

	if AC_Type_i = i_Arc then del 1
endif


END

'WARNING':

DEFINE STYLE 'WARNING' Arial, 2.5, 5, 0

SET STYLE 'WARNING'

TEXT2 0, 0, textThis

X1	=STW(textThis)/2000*GLOB_SCALE
Y1	=4.5/2000*GLOB_SCALE

POLY2_B 5, 2, 0, 0,
	X1, Y1, 1,
	X1, -Y1, 1,
	-X1, -Y1, 1,
	-X1, Y1, 1,
	X1, Y1, 1		

RETURN
And the Master Script:
r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerSize', index, type, flags, dim1, dim2, AC_MarkerSize)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerPen', index, type, flags, dim1, dim2, AC_MarkerPen)
r=REQUEST('ASSOCLP_PARVALUE', 'res_mark', index, type, flags, dim1, dim2, res_mark)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextFont_1', index, type, flags, dim1, dim2, AC_TextFont_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextSize_1', index, type, flags, dim1, dim2, AC_TextSize_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextStyle_1', index, type, flags, dim1, dim2, AC_TextStyle_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_TextPen_1', index, type, flags, dim1, dim2, AC_TextPen_1)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_MarkerText_1', index, type, flags, dim1, dim2, AC_MarkerText_1)
r=REQUEST('ASSOCLP_PARVALUE', 'shBackgroundFill', index, type, flags, dim1, dim2,shBackgroundFill)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_fill_type', index, type, flags, dim1, dim2, gs_fill_type)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_fill_pen', index, type, flags, dim1, dim2, gs_fill_pen)
r=REQUEST('ASSOCLP_PARVALUE', 'gs_back_pen', index, type, flags, dim1, dim2, gs_back_pen)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_LineType', index, type, flags, dim1, dim2, AC_LineType)
r=REQUEST('ASSOCLP_PARVALUE', 'AC_LinePen', index, type, flags, dim1, dim2, AC_LinePen)

parameters AC_LabelPointerLineType = AC_LineType
parameters AC_LabelPointerPen = AC_LinePen
parameters AC_LabelPointerConnection = 0
Solution
Podolsky
Ace
object also uploaded to BIM components
Eduardo Rolon
Moderator

Coming back to this, just started to notice an issue with the label that is faceted which looks wrong when exporting to PDF

Screen Shot 2021-09-10 at 1.44.50 PM.png

Eduardo Rolón AIA NCARB
AC27 US/INT -> AC08

Macbook Pro M1 Max 64GB ram, OS X 10.XX latest
another Moderator

Eduardo Rolon
Moderator

This is how it looks when exported as PDF.

Screen Shot 2021-09-10 at 2.21.30 PM.png

Eduardo Rolón AIA NCARB
AC27 US/INT -> AC08

Macbook Pro M1 Max 64GB ram, OS X 10.XX latest
another Moderator

Hey Eduardo,

 

Thank you very much for reporting this issue!

May I ask whether the issue comes from the object made in this thread, or it was a standard Archicad's Grid marker? Does it happen if you copy it to a new file?

 

Best regards,

Minh

Minh Nguyen
Technical Support Engineer
GRAPHISOFT