Attach user defined property sets per instance

Is it possible to attach a user-defined property set in the namespace "User" or "Custom" with "per instance" = "Yes" to a BIM element?
When importing IFC files with user defined property sets, corresponding "Custom" property sets are created in BricsCAD BIM.
Is there a special BricsCAD BIM command to attach user-defined property sets manually (per instance) to certain elements?
Is it possible to attach user-defined property sets with BricsCAD BIM LISP API?
I'm urgently looking for this funcitonality to be able to attach user-defined property set to 3DSolids classified as Building Element (ifcBuildingElementProxy).

Can someone help me please?
Thank you and kind regards!
Chris

Comments

  • Torsten Moses
    edited January 2021

    Hello, Chris,

    there is a LISP API for BIM properties, see our "Lisp Developer Support Package" documentation (freeware in application catalog), or our online help.
    Actually, the (bim:set-property) can not yet attach new custom properties, only edit existing properties.

    It is planned to have this improved/fixed with V21.2 (already works on my machine) ... so far, that should then work for you as you intend :smile:
    many greetings !

  • Dear Torsten,

    many thanks for the quick and detailed answers to my support request. I'm really looking forward to testing these functions in V21.2.

    Regarding bim:set-property - will this function only change values of existing properties or also add new ones to custom PSets?

    The following Lisp BIM functions would be very helpful in my opinion:

    Lisp functions for creating / changing / deleting new properties, if not already covered by bim: set-property, such as ...
    (bim:create-property PSetName PropertyID PropertyLabel PropertyDescription PropertyType Enum)
    (bim:delete-property PSetName PropertyID)

    Lisp functions for creating / changing / deleting user-defined property sets such as…
    (bim:create-pset PSetName PSetID PSetLabel Namespace PerInstance Visible Categories)
    (bim:delete-pset PSetName)

    Lisp functions for attaching user-defined PSets (perInstance = Yes) to selected elements such as ...
    (bim:attach-pset Entity PSetID)

    Such functions could be used to import / create large BIM data structures from Excel / CSV and assign them to selected elements.
    If such custom PSets could also be exported as IFC, then i guess this would be perfect for BIM users!

    Thank you very much for the development of "BLADE" and this extensive Lisp API - just beautiful :-)

    All the best!
    Chris

  • Dear Chris,

    so far, I tried to prevent reworking the entire (bim:set-property) function, for a new "NameSpace" parameter;
    actually, the (bim:set/get-property) function already has an optional last argument, for "Category" ... normally, that "Category" should correspond to a BIM property "NameSpace", but the BIM logic had changed over time, and so it never really matched.

    Besides, changing properties only works in propertysets for few "NameSpaces" only ... namely in "User";
    so the trick implemented now is :
    first attempt tries to create + edit the property in a same-named propertyset, as specified by "Category" in (bim:set-property);
    if that fails, LISP will internally fall-back to "User" namespace ...
    this approach applies to create, read and write operations, so it is fully transparent.

    This means :
    a) existing apps will start to work, withotu code change
    b) no extra code changes required to deal with "NameSpace" (and with "Category" in parallel ... rather confusing)

    The disadvantage is, tha LISP + BRX applications can not explicitly use an own, dedicated propertyset name - all API based properties are in "BIM Application Properties" propertiesset ... theoretically, for BRX based apps, it would be possible to automatically create a propertyset, based on the BRX app's "application name" ... but this is not possible for Lisp.

    Maybe, for V21.2, I might additionally add new (bim:set/get-ps-property) function, with explicit "propertyset" name ... ? The specified "propertyset" would be created automatically ... in case, it is not yet existing (which means, those functions to create/delete propertysets, as you suggested, also make sense !);
    I think this could be a good compromise, compatible forward + backward (I keep thinking about :smile: )

    I also noticed that deleting a property is not yet available ... so soem work remains till V21.2 :smile:

    If such custom PSets could also be exported as IFC, then i guess this would be perfect for BIM users!

    yes, clearly !! We are internally discussing about this ...

    many greetings !

  • Dear Thorsten,

    thank you again for your quick and detailed reply!
    My questions are answered now and I won’t bother you any longer.
    I’m looking forward to test V21.2 :smile:
    Kind Regards,
    Chris

  • Dear Chris,
    with V21.2, there will also be a new "LDSP package, with docs for the added + updated LISP functions ...
    https://www.bricsys.com/applications/a/?lisp-developer-support-package-(ldsp)-a720-al1176

    many greetings !

  • Dear Thorsten,

    thank you for adding additional Lisp functions for PSets/Properties!
    I am currently testing these functions on BricsCAD Version 21.2.02 x64, revision b633b408 as I could use them very well.

    Unfortunately, I do not get the expected result with the following function:

    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty1" "MyValue1")

    When I call this function for the first time and select a 3DSOLID, the PSet including property and value (string) is created correctly.

    If I want to add a second property to the PSet, then a property is created which has the PSet name and the corresponding value (string) instead of the property name.

    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty2" 123.456)

    If I want to add another property, it no longer works because the property name is the PSet name again.

    Another question where I’m not sure if I use the function in a wrong way is this:
    The “bimproperties” command can be used to select the type (Boolean, Integer, Real, String) when creating property definitions. In the Lisp function bim:pset-set-property it’s not necessary to define the type – this happens automatically depending on the entered value type.

    How can I enter a boolean value? If I use T / NIL then the value is 1 or 0 and the property type is integer and not Boolean.

    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty4" T)
    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty5" NIL)

    Would it also be possible to extend the function or another function to define an enum list for a property?

    In general it would be great if the possibilities that are available in the “bimproperties” command could be achieved by Lisp-functions. This would allow a flexible creation of a big number of PSets/Properties by importing Lists with BIM data structures.
    Sorry for bothering you again with my comments and special requests, but the possibilities that your Lisp-API can open is very interesting to me.

    Thank you and Best Regards,
    Chris

  • (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty1" "MyValue1")
    When I call this function for the first time and select a 3DSOLID, the PSet including property and value (string) is created correctly.

    If I want to add a second property to the PSet, then a property is created which has the PSet name and the corresponding value (string) instead of the property name.

    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty2" 123.456)
    If I want to add another property, it no longer works because the property name is the PSet name again.

    oops, this sounds like a bug, indeed :-( I will check + fix this problem ... with a little luck, for the upcoming V21.2.03

    How can I enter a boolean value? If I use T / NIL then the value is 1 or 0 and the property type is integer and not Boolean.
    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty4" T)
    (bim:pset-set-property (car (entsel)) "MyPSet" "MyProperty5" NIL)

    hmm, I will check if the properties system supports boolean type (likely it does), and will improve that as well.

    Would it also be possible to extend the function or another function to define an enum list for a property?

    also, I have to check how this could be made possible ...

    many greetings & more to come !

  • Dear Chris,

    as I could clearly reproduce, these 2 errors are now fixed; T/NIL is handled as true booleanBIM property now.
    I will care to get these fixes included in upcoming V21.2.03 ...

    The task to support enumerations is a bit bit bigger, needs more adjustments in both BRX and LISP interfaces; but I keep it on my TODO list :-)
    thanks and many greetings !

  • Dear Thorsten,
    thank you very much for quickly fixing this issues. I can imagine that the enum list is a bigger task, so i'm already more than happy if i can use the already existing functions.
    Thank you and Best Regards,
    Chris