Collaboration with other software
About model and data exchange with 3rd party solutions: Revit, Solibri, dRofus, Bluebeam, structural analysis solutions, and IFC, BCF and DXF/DWG-based exchange, etc.

label frame shape GDL

Anonymous
Not applicable
Hi all,

would anyone be able to let me know how to add a triangle text frame to the following script (If this is the right section of script, and if it's possible!) please? We'd like to have a triangle keynote label where the text rotates to always be readable if possible.

[my previous similar post was moved to the 'other products' section, but I believe this is just about scripting? Apologies if I'm incorrect!]

Thanks in advance!
!Frame {
	textBlockXMin = frameMargin
	!Frame Dimensions {
		if frameIsTight then
			if mirrorText then
				xL = textBlockXMin - frameMargin
				xR = textBlockXMax + frameMargin
			else
				xL = textBlockXMin - frameMargin
				xR = textBlockXMax + frameMargin
			endif
		else
			xL = 0
			xR = frameWidthReal*glob_scale
		endif
		yB = textBlockY - frameTopMargin
		yT = 0
	!} Frame Dimensions
	if (yT - yB > 0.001) and (xR - xL > 0.001) then
		if textAlignment = 3 then
			add2 frameWidth - (xR - xL), 0
		endif
		!Edges for the Frame Polygon {
			!Rectangle {
				if frameShape = 1 then
					put xL, yB, 1,
						xR, yB, 1,
						xR, yT, 1,
						xL, yT, 1
				endif
			!} Rectangle
			!Rounded Corners {
				if frameShape = 2 then
					Ri = min((yT - yB)/2 - .001, (xR - xL)/2 - .001, frameMargin*sqr(2))
					Ri = max(Ri, .00001)
					put (xL + xR)/2, yB, 1,
						xR - Ri, yB, 1,
						xR, yB + Ri, 1001,
						xR, yT - Ri, 1,
						xR - Ri, yT, 1001,
						xL + Ri, yT, 1,
						xL, yT - Ri, 1001,
						xL, yB + Ri, 1,
						xL + Ri, yB, 1001
				endif
			!} Rounded Corners
			!Hexagon {
				if frameShape = 3 then
					Ri = min((yT - yB)/2, (xR - xL)/2, frameMargin)
					put xL + Ri, yB, 1,
						xR - Ri, yB, 1,
						xR, (yB + yT)/2, 1,
						xR - Ri, yT, 1,
						xL + Ri, yT, 1,
						xL, (yB + yT)/2, 1
				endif
			!} Hexagon
			!Cut Corners {
				if frameShape = 4 then
					Ri = min((yT - yB)/2, (xR - xL)/2, frameMargin)
					put xL + Ri, yB, 1,
						xR - Ri, yB, 1,
						xR, yB + Ri, 1,
						xR, yT - Ri, 1,
						xR - Ri, yT, 1,
						xL + Ri, yT, 1,
						xL, yT - Ri, 1,
						xL, yB + Ri, 1
				endif
			!} Cut Corners
			!Vertical Line on Arrow Side {
				if frameShape = 5 then
					if label_position[2][1] > 0 then
						put xL, yB, 0,
							xR, yB, 1,
							xR, yT, 0,
							xL, yT, 0
					else
						put xL, yB, 0,
							xR, yB, 0,
							xR, yT, 0,
							xL, yT, 1
					endif
				endif
			!} Vertical Line on Arrow Side
			!Vertical Lines {
				if frameShape = 6 then
					put xL, yB, 0,
						xR, yB, 1,
						xR, yT, 0,
						xL, yT, 1
				endif
			!} Vertical Lines
			!No Border {
				if frameShape = 7 then
					put xL, yB, 0,
						xR, yB, 0,
						xR, yT, 0,
						xL, yT, 0
				endif
			!} No Border
		!} Edges for the Frame Polygon
		!Draw the Frame Polygon {
			if nsp then
				mask = 6
				if frameBorderPen > 0 then 
					mask = mask + 1
					pen frameBorderPen
				endif
				line_type frameLineType
				fill frameFillType
				poly2_b nsp/3, mask,
					frameFillPen, frameBkgdPen,
					get(nsp)
			endif
		!} Draw the Frame Polygon
		!Selectable Edge {
			hotline2 xL, yT, xR, yT
			hotline2 xL, yB, xR, yB
			hotline2 xL, yT, xL, yB
			hotline2 xR, yT, xR, yB
		!} Selectable Edge
	endif
!} Frame

end
6 REPLIES 6
Anonymous
Not applicable
I think you should bring this up directly with Cadimage.
After all, you are trying to modify their commercially available product "Cadimage Keynotes" you paid for.
Licensing issues related to modification of third-party commercial products aside, they could have a solution for you.

As a note of caution, if you make modifications to Cadimage (or any other subscription based service) code directly, these modifications might get lost next time Cadimage updates their tools.

As script you posted goes, it is just part of the picture and without looking at variable names used for this GDL object, master script looked at, macros checked, there is little help you are going to have short of a vague speculation.

Most of the times, it is much easier to wright custom GDL object you need from scratch than trying to adapt large commercial product to fit your needs. Large commercial products have a lot of development inertia and might take unreasonable amount of time to implement changes if their development roadmap is mapped out for a few years ahead.

I won't, probably, be able to help you with Cadimage object modifications, but if you need some GDL objects done from scratch we can easily do that. PM me if you have questions.
Anonymous
Not applicable
Thank you for the reply Anton,

I contacted Cadimage first before coming here, their response was 'No, it can't do that' and that was it. Not particularly helpful! I had hoped it would be a simple matter of adding a new frame option/ macro etc into the script that I would be able to muddle through, but it appears not.

We currently use the ArchiCAD Identification Label 19 as it's the only one we could find that can have a triangle frame, however it's not quite what we want (Ideally it would have a fill at the relevant point as in the attached image) and it doesn't link with the Cadimage Keynote Specification tool which we use, hence trying to alter the frame on the Cadimage label, rather than trying to add the Keynote script to a correct shape!

Is this something that you may be able to help with if you've time? No worries if not, and thank you for the advice in the meantime!
Anonymous
Not applicable
PrendosJoe wrote:
Is this something that you may be able to help with?
Sure. We can certainly work a solution for you.
Lets take this in private (PM or private messaging).
Anonymous
Not applicable
Thank you Anton, PM sent!
Anonymous
Not applicable
Apologies for the delay, but thank you for your help Anton!
Anonymous
Not applicable
PrendosJoe wrote:
Apologies for the delay, but thank you for your help Anton!
Glad I could help. You are welcome.