Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Polyline nodes to parametric form

Anonymous
Not applicable
I`d like to transform numeric nodes like this (i got them with drag&drop method):

105:
    pnum=39
PUT	    0,            0,      0 
PUT	           0.0392795,            0,      0 
PUT	           0.0392795,    0.1095692,      1 
PUT	           0.0392437,    0.1147646,      1 
PUT	           0.0396736,    0.1194417,      1 
PUT	           0.0405131,    0.1236261,      1 
PUT	           0.0417058,    0.1273432,      1 
PUT	           0.0431956,    0.1306186,      1 
PUT	            0.044926,    0.1334777,      1 
PUT	            0.046841,    0.1359461,      1 
PUT	           0.0488839,     0.138049,      1 
PUT	            0.050999,    0.1398123,      1 
PUT	           0.0531295,    0.1412612,      1 
PUT	           0.0552194,    0.1424213,      1 
PUT	           0.0572122,    0.1433178,      1 
PUT	            0.059052,    0.1439767,      1 
PUT	           0.0606822,    0.1444231,      1 
PUT	           0.0620467,    0.1446826,      1 
PUT	            0.063089,    0.1447805,      0 
PUT	           0.0631363,    0.1625932,      0 
PUT	           0.0658582,    0.1626122,      1 
PUT	           0.0682747,    0.1628674,      1 
PUT	           0.0704037,    0.1633422,      1 
PUT	           0.0722628,    0.1640205,      1 
PUT	           0.0738701,    0.1648855,      1 
PUT	            0.075243,    0.1659213,      1 
PUT	           0.0763995,    0.1671112,      1 
PUT	           0.0773573,    0.1684392,      1 
PUT	           0.0781343,    0.1698884,      1 
PUT	           0.0787481,     0.171443,      1 
PUT	           0.0792166,    0.1730863,      1 
PUT	           0.0795574,    0.1748022,      1 
PUT	           0.0797885,    0.1765741,      1 
PUT	           0.0799274,    0.1783858,      1 
PUT	           0.0799921,    0.1802208,      1 
PUT	           0.0800001,     0.182063,      1 
PUT	           0.0800001,         0.25,      0 
PUT	        2.739999999998E-005,         0.25,      0 
PUT	                   0,            0, 0     
to parametric nodes similiar to this (its taken from archicad moulding library):


105:
    pnum=15
    PUT 0, 0, 0
    PUT 0, zzyzx*13/67, 0
    PUT b*1/8.5, zzyzx*14/67, 0
    PUT b*1/8.5, zzyzx*56/67, 0
    PUT 0, zzyzx*57/67, 0
    PUT 0, zzyzx, 0
    PUT b*3/8.5, zzyzx, 0
    PUT b*4/8.5, zzyzx*65/67, 1
    PUT b*3.9/8.5, zzyzx*63.75/67, 1001
    PUT b*3.55/8.5, zzyzx*62.73/67, 1001
    PUT b*5/8.5, zzyzx*59/67, 1001
    PUT b*8/8.5, zzyzx*53/67, 1001
    PUT b*5.5/8.5, zzyzx*49/67, 1000
    PUT b, zzyzx*49/67, 0
    PUT b, 0, 0

I need to do this because i want my mouldings to be resizable.
the shape must be same.

thanks in advance for any tips.
10 REPLIES 10
Barry Kelly
Moderator
Drag & drop is a great way to get the number and position of nodes.
But to make them parametric you will need to adjust them manually.
Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
rocorona
Booster
I need to do this because i want my mouldings to be resizable.

If you only need to vary the scale of the polygon, then it can be somehow simple.
Draw the form in the Floor Plan window, placing it on the Global Origin. The Origin position will be the fixed point of the transformation (center of the profile, or an edge, as you need it).

Drag it in the 2D Script window

Create a multiplier parameter, let call it "scale", of type "real number".

Add the scale to all the coordinates, like this:
PUT       0 * scale,            0 * scale,      0 
PUT       0.0392795 * scale,    0 * scale,      0 
PUT       0.0392795 * scale,    0.1095692 * scale,      1 
PUT       0.0392437 * scale,    0.1147646 * scale,      1 
PUT       0.0396736 * scale,    0.1194417 * scale,      1 
PUT       0.0405131 * scale,    0.1236261 * scale,      1 
PUT       0.0417058 * scale,    0.1273432 * scale,      1 
You can automate the procedure, using the "Find & Replace function, substituting a simple comma with "*scale,"
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Good ideas Roberto, but size of the profile must be defined by user using zzyzx parameter.

I tried to make a workaround with IF stataments, but it doesn`t work


----------------
"skala" means scale

default dimensions of profile: zzyzx=0.22 b=0.06

Master Script:

IF num=101  THEN
   skala=b/0.06: PARAMETERS skala=skala: ENDIF  

IF num=101  THEN
   zzyzx=b*3.66666: PARAMETERS zzyzx=zzyzx: ENDIF 

3D script:


101:
    pnum=25
PUT	                   0*skala,            0*skala,     0
PUT	           0.0186566*skala,            0*skala,     0 
PUT	           0.018654*skala,    0.0636825*skala,      0 
PUT	           0.026527*skala,    0.06368*skala,        0 
PUT	           0.02659*skala,     0.1365975*skala,      0 
PUT	           0.0350715*skala,   0.1366137*skala,      0 
PUT	           0.0344461*skala,   0.1412077*skala,      0 
PUT	           0.0342521*skala,   0.1454709*skala,      1 
PUT	           0.0344594*skala,   0.1494084*skala,      1
PUT	           0.0350378*skala,   0.1530249*skala,      1 
PUT	           0.0359575*skala,   0.1563249*skala,      1 
PUT	           0.0371879*skala,   0.1593133*skala,      1 
PUT	           0.0386992*skala,   0.1619946*skala,      1 
PUT	           0.040461*skala,    0.1643737*skala,      1
PUT	           0.0424436*skala,   0.1664548*skala,      1 
PUT	           0.0446163*skala,   0.1682432*skala,      1 
PUT	           0.0469494*skala,   0.1697432*skala,      1 
PUT	           0.0494125*skala,   0.1709596*skala,      1 
PUT	           0.0519757*skala,   0.171897*skala,       1 
PUT	           0.0546086*skala,   0.1725603*skala,      1 
PUT	           0.0572812*skala,   0.1729539*skala,      1
PUT	           0.0599633*skala,   0.1730828*skala,      0 
PUT	                0.06*skala,       0.22*skala,    0 
PUT	                   0*skala,        0.22*skala,      0 
PUT	                   0*skala,            0*skala,     0


These scripts allow user to change size with b parameter (width), however using zzyzx (height) would be much more useful.

I wish I could know how Graphisoft create their parametric nodes. I`m sure it isnt done manually - it would take ages to make a library of over 20 mouldings.

I`d be grateful for any futher advice

Lukas

UPDATE:

Ok, now its possible to change size with zzyzx (just had to swap b to zzyzx )


IF num=101  THEN
   skala=zzyzx/0.22: PARAMETERS skala=skala: ENDIF  

IF num=101  THEN
   b=zzyzx/3.66666: PARAMETERS b=b: ENDIF 

Now, I`ve got a dream of two editable dimensions
I tried this, but its not working:

IF num=101  THEN
   skala=zzyzx/0.22: PARAMETERS skala=skala: ENDIF  

IF num=101  THEN
   b=zzyzx/3.66666: PARAMETERS b=b:
   zzyzx=b*3.66666: PARAMETERS zzyzx=zzyzx:  ENDIF 
It seems that the only way to get it done are parametric nodes...
rocorona
Booster
I can't follow the full logic of your object.
Why two "IF" statement with the same condition? (num=101)
And what is the "num" parameter for?

Another thing, I had many problems, in past version of GDL, with the ENDIF or ELSE command placed at the end of a row that contains the colon sign (:). Not sure if this has been corrected, but I've stopped to use that.

Finally, here:
IF num=101  THEN 
   b=zzyzx/3.66666: PARAMETERS b=b: 
   zzyzx=b*3.66666: PARAMETERS zzyzx=zzyzx:  ENDIF 

I see a recursive parameter change. B is changed using zzyzx value, then zzyzx is changed using the changed B value. I don't know how experienced you are in GDL, so I'm not sure if you really want this, or if this is an attempt of a workaround... I suspect you have to study the GLOB_MODPAR_NAME global variable.
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
Perhaps it would be easier to define the profile parametrically (with a few vertex co-ordinates and some mathematical curves), rather than point by point in this manner.
rocorona
Booster
Perhaps it would be easier to define the profile parametrically
Sure. But that's more for programmers than designers.
In the long term, learning good GDL programming gives you the best ArchiCAD tool.
People ask for a solution in the exact moment they need it, but learning requires time. We can suggest to take the opportunity to START studying... with the help of a good book!
_________________

--Roberto Corona--
www.archiradar.com
AC18 - ITA full on Win10
_________________
_________________
Anonymous
Not applicable
I`ve been learning GDL for 2 months and there is a long way ahead, but I got a task and a deadline so I must get it done with my current low knowledge.
Why two "IF" statement with the same condition? (num=101)
And what is the "num" parameter for?
the "num" parameter is connected with value list, i.e. 101 means "profile nr1"
The object is based on Archicad mouldning library, I just changed some scripts and nodes. There are scripts which I dont fully understand so I just left them untouched.
Perhaps it would be easier to define the profile parametrically (with a few vertex co-ordinates and some mathematical curves), rather than point by point in this manner.
It would be much better solution if I could only know how to do it. I`ve got real line of products (mouldings in corel draw or dwg format) and I need to put them in archicad.

Anyway, big thanks for your help and time. I`ll try to find some alternative way with help of Cookbook and GDL manual.

Pozdrawiam

Lukas
Anonymous
Not applicable
OK I understand the situation - sorry about my earlier post.

Perhaps the easiest way to create a bunch of profiles would be to draw them in an ArchiCAD plan view window as fill polygons. Then you could drag the fill polygons into the 2D script of an object to convert them to GDL script. From that point, its easy to copy/paste the polygon definitions into the 3D script, and adjust the status values (if required) to produce 3D elements.

Just a couple of things about this approach:
- To create the fill polygons, draw the outline with a polyline then spacebar-click to create a fill polygon. Adjust the magic wand settings to control the number of resulting edges.
- Create the fill polygons at the project origin.
- Create a 'target area' in the 2D script to drag the fill polygons into. Create several empty lines of code, and drag the fill polygons into this area of the script.
Barry Kelly
Moderator
Andrew wrote:
- Create a 'target area' in the 2D script to drag the fill polygons into. Create several empty lines of code, and drag the fill polygons into this area of the script.
I drag into the Interface Script if that is not being used.
This seems to work just as well as dragging into the 2D Script.
Barry.
One of the forum moderators.
Versions 6.5 to 27
Dell XPS- i7-6700 @ 3.4Ghz, 16GB ram, GeForce GTX 960 (2GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11