Das Wissen aller Anwender nutzen

Im Allplan Connect Forum tauschen sich Anwender aus, geben wertvolle Tipps oder beraten sich bei ganz konkreten Aufgabenstellungen − auch international.
Und damit wirklich keine Frage unbeantwortet bleibt, unterstützen die Mitarbeiter des Technischen Supports ebenfalls aktiv das Forum.

Es erwarten Sie:

  • Foren-Vielfalt aus CAD Architektur, CAD Ingenieurbau uvm.
  • Tipps von User für User
  • international: Deutsch, Englisch, Italienisch, Französisch und Tschechisch

Melden Sie sich jetzt an und diskutieren Sie mit!

Zur Registrierung

[Frage] Getting access to Floor Manager information [Gelöst]

Schlagworte:
  • Question
  • 2024

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.

Anhänge (1)

Typ: image/png
67-mal heruntergeladen
Größe: 36,22 KiB

Lösung anzeigen Lösung verbergen

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

Anhänge (2)

Typ: image/png
67-mal heruntergeladen
Größe: 119,31 KiB
Typ: image/png
40-mal heruntergeladen
Größe: 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

Anhänge (2)

Typ: image/png
30-mal heruntergeladen
Größe: 42,82 KiB
Typ: image/png
42-mal heruntergeladen
Größe: 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

Anhänge (2)

Typ: image/png
67-mal heruntergeladen
Größe: 119,31 KiB
Typ: image/png
40-mal heruntergeladen
Größe: 35,30 KiB

Hi,

A big thanks to both of you for your help.

Best regards.