cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Developer forum

Create Properties in Python

Sq_TMO
Participant

Hi!

 

I just stared studying Archicad module for Python and I'm not sure if it's my fault but I can't construct new properties.

 

from Archicad import ACConnection 

conn = ACConnection.connect()
assert conn

acc=conn.commands
act=conn.types
acu=conn.utilities

group_test = act.PropertyGroup("__Test Group__")

prop_test=act.PropertyDefinition(group_test, "__Test New Property__", "an expectant trial")

print(prop_test)

 

the result seems to be interesting if I take a look at the Python Palette:

 

Schermata 2022-07-27 alle 17.22.02.png

But in the end no property is created...

 

Am I wrong somewhere?

 

Many thanks!

1 ACCEPTED SOLUTION

Solution
bschwb
Enthusiast

Hi!

 

With your script you only created python objects of the classes "PropertyGroup" and "PropertyDefinition". I think that there are unfortunately no Python/JSON command to create Properties in Archicad.

 

I think only values of properties can be changed via the Python interface. (https://archicadapi.Graphisoft.com/JSONInterfaceDocumentation/#SetPropertyValuesOfElements)

 

Best, Bernd

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at www.bschwb.com/add-ons

View solution in original post

1 REPLY 1

Solution
bschwb
Enthusiast

Hi!

 

With your script you only created python objects of the classes "PropertyGroup" and "PropertyDefinition". I think that there are unfortunately no Python/JSON command to create Properties in Archicad.

 

I think only values of properties can be changed via the Python interface. (https://archicadapi.Graphisoft.com/JSONInterfaceDocumentation/#SetPropertyValuesOfElements)

 

Best, Bernd

Bernd Schwarzenbacher
Archicad Add-On Developer
Get (partially free) Add-Ons at www.bschwb.com/add-ons

Still looking?

Browse more topics

Back to forum

See latest solutions

Accepted solutions

Start a new discussion!