cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
License Delivery maintenance is expected to occur on Saturday, October 19, between 4 and 6 PM CEST. This may cause a short 60-minute outage in which license-related tasks: license key upload, download, update, SSA validation, access to the license pool may not function properly. We apologize for any inconvenience.
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.
SOLVED!

GDL Question: Making lineweights customizable for objects with multiple "views"

Reilly
Booster

I am currently working on a 2D object library for my office and trying to learn some basic GDL along the way. I recently created a few objects with multiple views (e.g. plan, front, side). I did this by copying my 2D linework into the 2D symbol window, placing each view on a separate layer, then using the "fragment2" command in the 2D script along with a view selection parameter to make it possible to switch between views in the object settings. This is based on advice from other threads and all works just fine. However, I am no longer able to edit the line weights (pens) for the object without opening the object and editing the actual object file or exploding the object. I could do this with previous 2D objects, but not with these now that the linework is in the 2D symbol section rather than in the 2D scripts.

 

Is it possible to add parameters for editing line weights if the drawing is in the 2D symbol window rather than scripted? If not, what would be the best way to go about creating an object that has both customizable lineweights and multiple view options? (Similar to the DET_Stud 27 object that is available in the default Archicad Library)

 

Operating system used: Mac Apple Silicon

2 ACCEPTED SOLUTIONS

Accepted Solutions
Solution
scottjm
Advisor

From recollection the second parameter in fragment2 determines whether the pens in the 2D symbol should be preserved or if they are overridden by previous DEFINE statements in the 2D script. I’m pretty sure however that all  pens should be allowed to be overridden by the Override Pen in floor plan and section display panel of the object regardless of this setting. But this is an all or nothing setting, so not always practical. 

Utilising Fragment2 is a nice easy method but you will always find the limitation when it comes to having more customisable pens of the displayed 2D line work. The best way to overcome this is to script the 2D line work so then you can assign specific parameters to different parts of your 2D symbol like the fill type, foreground and background pens etc. 

This is obvious lot more involved but will give you significantly more flexibility. 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

View solution in original post

Solution

Try just removing the MUL2 (or comment it out for testing purposes)

You’ll need to kept the ADD2, another intricacy when you Save as Object is that it will keep to co-ordinates of all your elements relative to the Archicad 0,0 origin and then adds the ADD2 with an inverse of the overall centre of your elements to make it appear centre on your object. Eg in your script it looks like the geometry was about x:121m y:80m from the origin before you saved it as an object. 

 

Not an issue if you’ve only got one set of linework or elements but again once you combine you’ll need to keep the add2 to align all your different sets of linework. 

 

The best way to overcome this is make sure your linework is aligned to the Archicad 0,0 origin before saving it as an object. 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

View solution in original post

7 REPLIES 7
Solution
scottjm
Advisor

From recollection the second parameter in fragment2 determines whether the pens in the 2D symbol should be preserved or if they are overridden by previous DEFINE statements in the 2D script. I’m pretty sure however that all  pens should be allowed to be overridden by the Override Pen in floor plan and section display panel of the object regardless of this setting. But this is an all or nothing setting, so not always practical. 

Utilising Fragment2 is a nice easy method but you will always find the limitation when it comes to having more customisable pens of the displayed 2D line work. The best way to overcome this is to script the 2D line work so then you can assign specific parameters to different parts of your 2D symbol like the fill type, foreground and background pens etc. 

This is obvious lot more involved but will give you significantly more flexibility. 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

Thanks Scott, this is helpful. I've been playing around with it for a little bit and I think I got it to work by replacing the Fragment2 command with the actual 2D script for the objects I want to appear in each view. I now have an object that has multiple views and editable line weights. So, technically, goal accomplished.

 

However, now, when I switch between views, the object is distorted based on the dimensions of the first view. I assume this is because of the A and B dimension parameters, but I can't figure out how to get rid of them or get around them so that each "view" is drawn to the correct size. Is there a way to get these dimensions to change depending on which view is selected or just get rid of them entirely?

 

Reilly_0-1726872292352.png

 

My suspicion would be there is a MUL2 command in your 2D scripts. When Archicad creates 2D script from line work it does it in a really convoluted way that is intended to allow it to be scalable based on A and B. But as you are experiencing this only works when A and B are correct for your original linear overall size. 

can you post your 2D script?

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

 The full script is very long as I have a number of views, so I am just pasting one of them but they all follow essentially the same format, just with different lines and shapes. There is a mul2 command as you suspected - I drew the objects as normal 2D drawings then had archicad generate the script and just copied it right in. I didn't want to mess with it beyond what I know so far.

 

if view_select=8 then
mul2 A/2.032000, B/0.850900
add2 -121.0097950115, 80.88430793471
drawindex 10
pen BG_fill_pen
fill BG_Fill
poly2_b{5} 23, 2, 0, 3, BG_fill_pen, BG_fill_pen,
0, 0, 1, 0, 0, 1, 0,
121.2637950196, -80.03340779065, 1,
121.1791283529, -80.03340779065, 900,
0, -90, 4001,
121.1791283529, -80.14982446716, 1,
121.1498012351, -80.14984149573, 1,
121.1484455969, -80.20380838242, 900,
0, 181.4389567585, 4001,
121.1568944411, -80.25779229768, 1,
121.1568944411, -80.26412454782, 1,
121.1367950196, -80.26412454782, 1,
121.1367950196, -80.2895245533, 1,
121.1367950196, -80.32903566476, 900,
0, -90, 4001,
121.0972839081, -80.32903566477, 900,
0, -84.36364990042, 4001,
121.1050450196, -80.43980789708, 1,
121.1050450196, -80.53505790515, 900,
0, 180, 4001,
121.0097950196, -80.63030791321, 1,
121.0097950196, -80.88430793471, 1,
122.0257950196, -80.88430793471, 1,
122.0257950196, -80.03340779065, 1,
121.2637950196, -80.03340779065, 1
fill BG_Fill
poly2_b{5} 23, 2, 0, 3, BG_fill_pen, BG_fill_pen,
0, 0, 1, 0, 0, 1, 0,
122.7877950196, -80.03340779065, 1,
122.0257950196, -80.03340779065, 1,
122.0257950196, -80.88430793471, 1,
123.0417950196, -80.88430793471, 1,
123.0417950196, -80.63030791321, 1,
122.9465450196, -80.63030791321, 1,
122.9465450196, -80.53505790515, 900,
0, 180, 4001,
122.9465450203, -80.40767583821, 1,
122.9543061311, -80.32903566477, 900,
0, -84.36364990042, 4001,
122.9147950196, -80.32903566476, 900,
0, -90, 4001,
122.9147950196, -80.26412454782, 1,
122.8946955981, -80.26412454782, 1,
122.8946955981, -80.25779229768, 1,
122.9031444423, -80.25779229312, 1,
122.9031444423, -80.20380838242, 900,
0, 181.4389567585, 4001,
122.8724616863, -80.14982446716, 1,
122.8724616863, -80.11807445733, 1,
122.8724616863, -80.03340779065, 900,
0, -90, 4001
pen General_pen
set line_type lineTypeAttribute_1
line_property 0
line2 121.1791283529, -80.14982446716, 122.8724616862, -80.14982446716
line2 121.1791283529, -80.11807446447, 122.8724616862, -80.11807446447
line2 122.9465450196, -80.63030791321, 121.1050450196, -80.63030791321
line2 121.1050450196, -80.43980789708, 122.9465450196, -80.43980789708
line2 121.1367950196, -80.28952454997, 122.9147950196, -80.28952454997
line2 121.1050450196, -80.40805789439, 122.9465450196, -80.40805789439
line2 121.1568944411, -80.25779229768, 122.894695598, -80.25779229768
line2 121.1568944411, -80.26412454782, 122.894695598, -80.26412454782
pen Outline_pen
arc2 121.1050450196, -80.53505790515, 0.09525000001742, 90, 270
line2 121.1050450196, -80.43980789708, 121.1050450196, -80.40805789439
line2 121.1367950196, -80.28952454997, 121.1367950196, -80.26412454782
line2 121.1568944411, -80.25779229768, 121.1568944411, -80.26412454782
arc2 121.1367950196, -80.32903566477, 0.03951111147308, 0, 90
arc2 121.0972839081, -80.32903566477, 0.07902222294615, 275.6363500996, 0
line2 121.1568944411, -80.26412454782, 121.1367950196, -80.26412454782
line2 121.1791283529, -80.14982446716, 121.1498012352, -80.14984149126
line2 121.1050450196, -80.63030791321, 121.0097950196, -80.63030791321
line2 121.0097950196, -80.63030791321, 121.0097950196, -80.88430793471
line2 121.1791283529, -80.14982446716, 121.1791283529, -80.11807446447
arc2 121.1791283529, -80.03340779065, 0.08466666668218, 270, 0
line2 121.0097950196, -80.88430793471, 123.0417950196, -80.88430793471
line2 121.1568944411, -80.25779229768, 121.1484455969, -80.25779229768
arc2 121.1484455969, -80.20380838242, 0.05398391069795, 88.56104324152, 270
arc2 122.9465450196, -80.53505790515, 0.09525000001742, 270, 90
line2 122.9465450196, -80.43980789708, 122.9465450196, -80.40805789439
line2 122.9147950196, -80.28952454997, 122.9147950196, -80.26412454782
line2 122.894695598, -80.25779229768, 122.894695598, -80.26412454782
arc2 122.9147950196, -80.32903566477, 0.03951111147308, 90, 180
arc2 122.954306131, -80.32903566477, 0.07902222294615, 180, 264.3636499004
line2 122.894695598, -80.26412454782, 122.9147950196, -80.26412454782
line2 122.8724616862, -80.14982446716, 122.9017888039, -80.14984149126
line2 122.9465450196, -80.63030791321, 123.0417950196, -80.63030791321
line2 123.0417950196, -80.63030791321, 123.0417950196, -80.88430793471
line2 122.8724616862, -80.14982446716, 122.8724616862, -80.11807446447
arc2 122.8724616862, -80.03340779065, 0.08466666668218, 180, 270
line2 122.894695598, -80.25779229768, 122.9031444422, -80.25779229768
arc2 122.9031444422, -80.20380838242, 0.05398391069795, 270, 91.43895675848
pen Hotspot_pen
hotspot2 121.0097950196, -80.88430793471
hotspot2 122.0257950196, -80.88430793471
hotspot2 123.0417950196, -80.88430793471
hotspot2 122.7877950195, -80.03340779065
hotspot2 121.2637950196, -80.03340779065
hotspot2 122.0257950196, -80.03340779065
ENDIF

I'm not sure if my replies are going through, it looks like they did but I can't see them, so I am assuming they haven't because the script is too long. I've included the first few lines - the rest is just coordinates and such for the lines and fills. Would it work to just remove the MUL2 and/or ADD2 commands?

 
if view_select=8 then
mul2 A/2.032000, B/0.850900
add2 -121.0097950115, 80.88430793471
drawindex 10
pen BG_fill_pen
fill BG_Fill
poly2_b{5} 23, 2, 0, 3, BG_fill_pen, BG_fill_pen,
0, 0, 1, 0, 0, 1, 0,
121.2637950196, -80.03340779065, 1,
Solution

Try just removing the MUL2 (or comment it out for testing purposes)

You’ll need to kept the ADD2, another intricacy when you Save as Object is that it will keep to co-ordinates of all your elements relative to the Archicad 0,0 origin and then adds the ADD2 with an inverse of the overall centre of your elements to make it appear centre on your object. Eg in your script it looks like the geometry was about x:121m y:80m from the origin before you saved it as an object. 

 

Not an issue if you’ve only got one set of linework or elements but again once you combine you’ll need to keep the add2 to align all your different sets of linework. 

 

The best way to overcome this is make sure your linework is aligned to the Archicad 0,0 origin before saving it as an object. 

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

Perfect, that seems to have worked. Thanks for your help Scott.

Setup info provided by author