How to I get the parameters section of a BIM Object?

Also, why are properties width, height, depth null?

here's the code I'm goofing around with

import traceback
from pyrx_imp import Ap, Db, Ed, Ge, Gi, Gs, Rx, Bim

def PyRxCmd_doit():
    try:
        
        ps, id, pnt = Ed.Editor.entSel("\nBe tHe Rizz kIng: ")
        if not Bim.BimClassification.isClassifiedAsAnyBuildingElement(id):
            return

        if Bim.BimClassification.getClassification(id) != Bim.BimElementType.eBimStair:
            return
        
        vd = {}
        
        for name, cat in Bim.BimClassification.getPropertyDict(id).items():
            val = Bim.BimClassification.getProperty(id,name,cat)
            match val.dataType():
                case Db.ValueDataType.kString:
                    vd[name] = val.getString()
                case Db.ValueDataType.kLong:
                    vd[name] = val.getInt32()
                case Db.ValueDataType.kDouble:
                    vd[name] = val.getDouble()
                case Db.ValueDataType.k3dPoint:
                    vd[name] = val.getPoint3d()
                case _:
                    vd[name] = ("NULL", val.dataType())
                    
        print(vd)

    except Exception as err:
        traceback.print_exception(err)

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Hello.

    I am not sure about the Python approach.

    With using lisp, the parameters can be listed by using the (dumpallproperties) function.
    They are found in the "MCAD Properties" category.
    They can be retrieved and edited with (getpropertyvalue) and (setpropertyvalue).

    Another way of working, still using lisp, would be to use some functions from the Mechanical Lisp API.
    Mechanical Components Functions

  • edited October 2024

    Thanks for that, Python actually just using BRX, I’ll have a look in the Mechanical API for BRX

  • @Its_Alive keep on rockin!

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.