Forum de la communauté Allplan

[Question] Getting access to Floor Manager information [Résolu]

Balises:

Hello,

I need to gain access to floor manager information by using some way in the Python Api Interface inside a PythonPart.

For example, based on Printscreen1 (in file here appended), I would need to gain access to the string '-HKA' from inside an element of drawing file 241.
Another option could be , based on Printscreen2 (in file here appended) to gain access to the string 'LEVEL_HKA' based on the PlaneReferences of my selected element.

Is there something in the Python Api allowing this kind of operation (I couldn't find such function neither in DocumentNameService, neither in BottomTopPlaneService...)

Thank you for your help.

Pièces-jointes (1)

Type: image/png
Téléchargé 58 fois
Size: 36,22 KiB

Show solution Hide solution

Hi,

the approach from Christophe is I think the best for your use-case. I would personally do it exactly like this.
Create user attributes, one per each part of your unique name. The attributes for non-topology-related parts:

  • FamilyEquipmentCode
  • ObjectSpecializationCode
  • OrderNumber

Assign these attributes directly to your PythonPart in the script.

Assign the building code to the building itself in the building structure (right-click on the story: assign attributes). See attached image. Do the same with the story number.

Then define a formula attribute (In my example on the screen shot it is the ElementCode), that incorporates all the information you need into one string. E.g. like this:

TOPOLOGY("Building";@BuildingCode@)+"|"+TOPOLOGY("Story";@StoreyNumber@)+"|"+@Code text@
You can also assign it on your PythonPart in the script, just without providing a value, because it will be calculated by Allplan.
Alternatively: instead of accessing the attributes of site/building/story you with TOPOLOGY(...) (which is possible only in Allplan 2024) you can access their name with @586@, @451@, @452@ respectively. See ...\prg\AttributeManager.exe what numbers you must access. Search for attributes with the name beginning with "Topology_..."

I am aware, that the information about the building code and the story number are not taken from the floor manager as you planned to do that, but from the building structure. This is however better place for this kind of information

Pièces-jointes (2)

Type: image/png
Téléchargé 54 fois
Size: 119,31 KiB
Type: image/png
Téléchargé 28 fois
Size: 35,30 KiB

Hi,

I am not sure if I am understanding your problem correctly.

For the first question: if you would like to get some subset from the name string of the drawing file, you can do it with the DocumentNameService you mentioned. E.g. with the GetLoadedDocumentsNameData to get the DF-names of the currently loaded files.

Getting the name of the plane from the floor manager will be probably tricky. Plane reference is kept in the element as a Plane ID. I think, there is no way to get the name of the floor based on the plane id that belongs to it. At least not with Python API. Maybe it is possible with a calculated attribute?

But can you explain you use-case a little more in detail here? Maybe we can figure sth out.

Best regards,
Bart.

Hi,

Here is my use-case:
I have to give a unique name to any component belonging to a specific type list in the selected drawing file.

This unique name is based on the following information : BuildingCode/StoreyNumber/FamilyEquipmentCode/ObjectCategoryCode/ObjectSpecializationCode/OrderNumber.

While I have available the pieces of information for FamilyEquipmentCode/ObjectCategoryCode/ObjectSpecializationCode thanks to attribute values that have been beforehand set (as far as he is concerned, OrderNumber relies on requesting data model...), I cannot actually find reliable information for BuildingCode and StoreyNumber somewhere else the floor manager because the naming of the drawing file could be wrong towards BuildingCode and/or StoreyNumber.

That's why it would have been fine to have some kind of way of retrieving information from the floor manager.

Best regards

Hi,

Have you tried to find this information with TOPOLOGY in a formula ?

example with a custom attribute BUILD_STR => "Ma valeur est : "+TOPOLOGY("Building";@BUILD_STR@

Best

edit : you can set "Site", "Building" or "Storey" and choose an attribute

Pièces-jointes (2)

Type: image/png
Téléchargé 22 fois
Size: 42,82 KiB
Type: image/png
Téléchargé 32 fois
Size: 27,50 KiB

Hi,

the approach from Christophe is I think the best for your use-case. I would personally do it exactly like this.
Create user attributes, one per each part of your unique name. The attributes for non-topology-related parts:

  • FamilyEquipmentCode
  • ObjectSpecializationCode
  • OrderNumber

Assign these attributes directly to your PythonPart in the script.

Assign the building code to the building itself in the building structure (right-click on the story: assign attributes). See attached image. Do the same with the story number.

Then define a formula attribute (In my example on the screen shot it is the ElementCode), that incorporates all the information you need into one string. E.g. like this:

TOPOLOGY("Building";@BuildingCode@)+"|"+TOPOLOGY("Story";@StoreyNumber@)+"|"+@Code text@
You can also assign it on your PythonPart in the script, just without providing a value, because it will be calculated by Allplan.
Alternatively: instead of accessing the attributes of site/building/story you with TOPOLOGY(...) (which is possible only in Allplan 2024) you can access their name with @586@, @451@, @452@ respectively. See ...\prg\AttributeManager.exe what numbers you must access. Search for attributes with the name beginning with "Topology_..."

I am aware, that the information about the building code and the story number are not taken from the floor manager as you planned to do that, but from the building structure. This is however better place for this kind of information

Pièces-jointes (2)

Type: image/png
Téléchargé 54 fois
Size: 119,31 KiB
Type: image/png
Téléchargé 28 fois
Size: 35,30 KiB

Hi,

A big thanks to both of you for your help.

Best regards.


https://connect.allplan.com/ utilise des cookies  -  Plus d'informations

Accepter