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] Text values using PythonParts

Schlagworte:
  • Text
  • Attribute
  • PythonParts

Hello everyone! I have some questions in PythonParts.

1. Is it possible to get text value from model using python script?
2. Is it possible to get attribute value from existing object using python?

GeometrySelectInteractor in Examples folder shows simple way how to use
python API to get geometry values but i can't find any information about attributes
and texts.

If you have any information about it, please give me know.

Hi Kriks,
tried it multiple times, also digging through documentation... well, still I am not 100% sure, but almost sure that you cannot access objects that were created before creating your PythonPart as a result of normal Allplan commands.
Although there is GUID for each object (see https://pythonparts.allplan.com/ -> NemAll_Python_Utility) and in IFW_Input module you have GetInputViewDocument methods which allow you to get active document... the document is a DocumentAdapter instance, you can get DocumentID of it, but that's where I have no more ideas

Thank you for answer. It upsets me a little. Hope in future we' ll get additional methods for attributes and texts manipulations with further extension of API.

did you figure it out how to do this?

With Allpan 2018-1-10 It is possible to get list of attribute values from model objetcts using ElementsAttributeService class from NemAll_Python_BaseElements