Archicad C++ API
About Archicad add-on development using the C++ API.

Parameter script default value

Ady84a
Booster

Hallo all,

 

When I creat a new Parameter (para1) inside an existing object it has a default value. Let's say the value is "".

now I change the value of the parameter in the Masterscript, then write in the Parameter script (Parameters para1  =  Parameters para1)

the value doesn't change unless I run the Parameter script for all the objects so that the value changes.

Is there a way to avoid runing the Parameter script when I creat a new Parameter in an existing object with a value calculated from the master script?

Because there are thausends of objects and hundreds of files. when I run the parameter script it works, but it takes a lot of time.

 

best regards

3 REPLIES 3

If the objects are placed then if You update the object and add some parameter, after relading libraries in the project they will get the default value as You edited. The problem is with existing parameter and if the default is changed...

Lingwisyer
Guru

Change the name of the parameter, probably breaking the object. Propagate the change. Fix the name with the new default value. Propagate the fix? Though now you are spending all the time reloading libraries which you could have spent selecting all and manually changing the values...

 

Though, if the value is calculated in the Master Script, what the parameters list shows is not relevant anyway and has no effect on the output?

AC22-23 AUS 7000Help Those Help You - Add a Signature
Self-taught, bend it till it breaksCreating a Thread
Win10 | R5 2600 | 16GB | GTX1660 
Peter Baksa
Graphisoft
Graphisoft

Only the parameter script can set parameters, so no.

You can manually trigger a parameter script run on all placed objects with the Library Developer menu command Run Parameter Script on Placed Library Parts.

 

The parameter script is also run after forward migration.

  1. Copy the GUID of the object in the libpart editor (Edit / Insert Own GUID)
  2. Paste it into a new MIgration table entry
    1. check AutoMigration if the migration scripts are empty
    2. or add an empty migration step if there is existing migration code
  3. Save the object as a new one (Create New Library Part in the Save As dialog).

This way the old placed objects will be migrated to the new when loading the new library part. You don't have to open each file, but the users have to manually add the new library part in library manager.

Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest