Support Forum

[Frage] Check if rebar habve a label

Schlagworte:
  • Label
  • Reinforcement
  • Pythonpart

Hello,

i want to know, if there is a function in the API to check, if a rebar have a label. We need a PythonPart, which checks if all reinforcement got a labeling, because sometimes we forget to label some bars.

The only function i find ist the IsLabelElement() but i think, its not what i'm looking for.

Hilfreichste Antwort anzeigen Hilfreichste Antwort verbergen

Hi,

to check this, you will have to work solely with BaseElementAdapter. Let's consider a simple linear bar placement: 10 stirrups are placed along a line in a 3D model. There are two sections in the drawing file showing this placement. You probably want to make sure, that the placement is labeled in all the sections.

When you select all elements with NemAll_Python_BaseElements.ElementsSelectService.SelectAllElements(), you will get a bunch of elements adapters and it is important to understand, what they represent:

  • BarsRepresentationLine_TypeUUID - represents every single line in every of the section. There will be 20 of those (10 stirrups * 2 sections). Each line belongs to:
  • BarsRepresentation_TypeUUID - represents the group of representation lines, that represents a certain bar placement in a given section. In our case there will be two of these, because we have two sections in the DF. Each of these belongs to:
  • BarsLinearPlacement_TypeUUID - represents the placement itself. There will be one, because we have only one placement. It belongs to:
  • BarsDefinition_TypeUUID - represents the bar shape, that is being places. You can imagine, that you can place the same shape with more than one placement.

So the hierarchy (from Parent to child) is: BarsDefinition_TypeUUID -> BarsLinearPlacement_TypeUUID -> BarsRepresentation_TypeUUID -> BarsRepresentationLine_TypeUUID.

From all the selected base element adapters, you will have to filter only these of type BarsRepresentation_TypeUUID and inspect its child elements (using GetChildModelElements). If among them, there is a base element adapter of type EngineerLabel_TypeUUID, it means that this particular placement representation is labeled.

It's difficult to understand without an example, so I attached one. It works with Allplan 2025 (release planned for tomorrow). Start it and select a placement. In the trace you will see, whether it's labeled or not.

Hope that helps.

Baest,
Bart

Anhänge (1)

Typ: application/zip
161-mal heruntergeladen
Größe: 2,30 KiB

Hi,

to check this, you will have to work solely with BaseElementAdapter. Let's consider a simple linear bar placement: 10 stirrups are placed along a line in a 3D model. There are two sections in the drawing file showing this placement. You probably want to make sure, that the placement is labeled in all the sections.

When you select all elements with NemAll_Python_BaseElements.ElementsSelectService.SelectAllElements(), you will get a bunch of elements adapters and it is important to understand, what they represent:

  • BarsRepresentationLine_TypeUUID - represents every single line in every of the section. There will be 20 of those (10 stirrups * 2 sections). Each line belongs to:
  • BarsRepresentation_TypeUUID - represents the group of representation lines, that represents a certain bar placement in a given section. In our case there will be two of these, because we have two sections in the DF. Each of these belongs to:
  • BarsLinearPlacement_TypeUUID - represents the placement itself. There will be one, because we have only one placement. It belongs to:
  • BarsDefinition_TypeUUID - represents the bar shape, that is being places. You can imagine, that you can place the same shape with more than one placement.

So the hierarchy (from Parent to child) is: BarsDefinition_TypeUUID -> BarsLinearPlacement_TypeUUID -> BarsRepresentation_TypeUUID -> BarsRepresentationLine_TypeUUID.

From all the selected base element adapters, you will have to filter only these of type BarsRepresentation_TypeUUID and inspect its child elements (using GetChildModelElements). If among them, there is a base element adapter of type EngineerLabel_TypeUUID, it means that this particular placement representation is labeled.

It's difficult to understand without an example, so I attached one. It works with Allplan 2025 (release planned for tomorrow). Start it and select a placement. In the trace you will see, whether it's labeled or not.

Hope that helps.

Baest,
Bart

Anhänge (1)

Typ: application/zip
161-mal heruntergeladen
Größe: 2,30 KiB