2019-07-19 11:22 AM - last edited on 2022-10-05 01:24 PM by Daniel Kassai
2019-11-24 02:37 PM
2019-11-24 02:42 PM
Karl wrote:Thanks for your reply.
2019-12-02 05:02 PM
2019-12-03 08:10 AM
2019-12-03 10:04 AM
Petar.Pejic wrote:I sometimes do this: if I can not find how to access the desired parameter then I use *.List(). The console unloads a list of all parameters and you can try to find the one that affects the composite wall.
I managed to get and change ID of elements, but I am struggling how to get for example composite name of the wall? Should one use getproperty or getattribute?
guid = ClickElement() element = GetWall(guid) index_attrib_composit = 19 index_attrib_build_mat = 3 element.modelElemStructureType = 1 # 0 - non-composit, 1 - composit, 2 - profile if element.modelElemStructureType == 1: element.composite = number_att_composit else: element.buildingMaterial = index_attrib_build_mat ChangeWall(element)
2019-12-03 11:08 AM
2019-12-03 11:34 AM
Petar.Pejic wrote:Well the first thing that came to mind:
That is a great tip, thank you for sharing your knowledge!
Additional question, how do you get string for the name of the specific composite / building material or anything else rather then the number? What would be the logic behind it?
dict_comp_wall = GetAttributeDictionary(API_CompWallID) index_attrib_composit = 19 for key, attribute in dict_comp_wall.items(): if index_attrib_composit == attribute.index: print(key, attribute.name)Accordingly as a parameter name (attribute.*) can be anything that refers to it
2019-12-03 05:27 PM
2019-12-04 01:47 AM
2019-12-04 07:59 AM
poco2013 wrote:Please show the script, I almost understood
I've been experimenting with the python functions and ran into a problem with the CreateText function. I was trying to duplicate the the rich text example in the Element Test example add_on.
The problem is that the structure used - API_ParagraghType - uses as its first value 'from'. This is a keyword in Python and is a error if used as a variable. Is there any workaround for this problem? Anyone have any code to duplicate the rich text example?