cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
2024 Technology Preview Program

2024 Technology Preview Program:
Master powerful new features and shape the latest BIM-enabled innovations

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

object sizes A and B and options

Anonymous
Not applicable
Hi,

Sometimes i do objects by coding but some objects are just easier to draw w fills and then 'save selection as object.'

Currently I am doing it for 1 object with many variants of it (w different sizes or shapes)

My questions are the following :

FIRST

Because am combining in one object many versions the sizes of A and B are always of the first option even if the second option has different sizes.

I went around this by inserting the code in the 'Parameter' tab:

IF optx='135x220' THEN

PARAMETERS A=0.220, B=0.135

ENDIF

IF optx='135x240' THEN

PARAMETERS A=0.240, B=0.135

ENDIF


But i have to do this for every single option. Is there a code i can use for archicad to take A and B automatically from the limts of the object?

SECOND

I plan on using this object in different projects (saving it in a container file) and keep adding versions with (with on off buttons or values) of it as time go on (updating the container file everytime) . Do you see any problem with this method? will my previous placed objects be fine or will they change?


I hope the text is clear.

Thanks in advance

Luis
6 REPLIES 6
Dave Seabury
Advocate
Luis

You need to split the 135x220 in to useable parameters. The easiest way to see this is to
look at the scripting (master script) of the DET_Stud object in the standard library. It is
a little tricky to figure out at first, but it will get you what you are after.

David
AC 19-24 Windows 10 64 bit, Dell Prercision 7820, Xeon Silver 2414R ( 12 Cores), 64 GB Ram, Quadro RTX 4000 8GB
Lingwisyer
Guru
Dave wrote:
the scripting (master script) of the DET_Stud object in the standard library.
Which library is this in? I cannot find it in the AC21 AUS default library.


Ling.

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Barry Kelly
Moderator
You will want to do something like this in the master or parameter script.
n=SPLIT(optx, "%nx%n", width, string, height)

A = width/1000
B = height/1000

PARAMETERS A = A
PARAMETERS B = B
It is best to set the value of your parameter as well as set the actual parameter.
i.e.
A = width/1000
PARAMETERS A = A

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Barry Kelly
Moderator
Luiscardoso wrote:
I plan on using this object in different projects (saving it in a container file) and keep adding versions with (with on off buttons or values) of it as time go on (updating the container file every time) . Do you see any problem with this method? will my previous placed objects be fine or will they change?
It depends on what you are changing as it can affect already placed objects if you change the way the existing scripts work.
But if you are just adding new features and keeping the existing ones as they are, generally you should be fine.
Just make sure you 'Save' replacing the original object and do not 'Save As' with the same name as this will create a new object with a new GUID.
Existing objects will not be updated if you 'Save As'.

You may find if you are always updating the object that a container file can be a bit of a pain to extract and create all of the time.
The objects do not need to be in an LCF.

Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11
Lingwisyer
Guru
Found thread which seems to talk about the same thing. Breaking a string into parts to use as dimensions.


Ling.

ps. Woo! 50 line reduction!

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win11 | i9 10850K | 64GB | RX6600 Win10 | R5 2600 | 16GB | GTX1660
Anonymous
Not applicable
thanks a lot for all the answers guys.

Luis