Foro de Soporte Allplan

[Pregunta] Rotationswinkel auslesen

Etiquetas:
  • Allplan
  • SmartPart
  • Rotation
  • Winkel
  • Parameter

Hallo,

wenn ich ein SmartPart um 90° Grad drehe, dann kann ich unter "Eigenschaften->Geometrie->Winkel um Z" den Drehwinkel ablesen. Auf diesen Wert würde ich gerne im Skript zugreifen. Ich beiße mir daran leider die Zähne aus.

Laut der Seite http://smartparts.tzbm.at/basic-referenz/globale-variablen soll es eine globale Variable "GLOB_ROTANGLE" geben, allerdings kann ich nicht auf diese Variable zugreifen.

Wir verwenden hier die Version 2016 von Allplan. Kann es sein, dass es einige Funktionen, Variablen, etc. noch nicht in dieser Version gibt?

Ich würde mich über Tipps freuen

Vielen Dank

Hello,
Unfortunately, you cannot get the coordinates and the rotation angle made outside the SmartPart.
"SYMB_ROTANGLE" is not supported (cf. online help: "Not supported in current SmartParts version."). This is from the first version in Allplan 2012 and nothing has changed since...
The only way you can follow is to create inside the SmartPart (with the code) a procedure to rotate your object.


Merci Bertrand,

so now I can stop trying it further ;)

Yes, spend time to make something else!...
Good luck.


Es hat einen Grund, warum man "Lage-Werte" wie Koordinaten und Winkel nicht im SmartPart lesen kann.

Ein SmartPart verhält sich wie ein normales Makro: jede der Verlegungen basiert auf der einen Makro-Definition. Wenn man eine Verlegung ändert, ändern sich alle anderen Verlegungen mit!

Stell Dir vor, Du hast ein SmartPart kopiert, und die Kopie gedreht.
Das Script gilt aber für beide Verlegungen, d.h. beide (Makro-)Verlegungnen basieren auf demselben Mutter-Objekt (der Makro-Definition)! Wenn man jetzt beim Script-Durchlauf abhängig vom Winkel einer Verlegung etwas ändert, z.B. die Farbe von Rot auf Blau ändert, wenn das SmartPart gedreht ist, würde sich dadurch ja auch das nicht gedrehte SmartPart verändern, da beide auf demselben Script mit dem Ergebnis der Makro-Definition basieren. Und das kann nicht sinnvoll sein...

Hi Jörg,
If you copy a SmartPart and change just the value of a parameter, the both SmartParts are treated as 2 different ones.
Then, if the copy of a SmartPart is blue because it is rotated, this is like there are 2 different ones. It's working clearly already now...

This is based on how Allplan has always worked but it is not forbidden to make improvements and to offer more possibilities. It would be very appreciated.
So, it could make sense to get this kind of information (coordinates, rotation angle, and some other properties/attributes).

Please, don't hesitate to contact me directly if you want more details on what would be really useful to improve SmartParts (if needed, Anja has my email address)...
Thanks!


...you are right, that work, if you change a parameter.
But SYMB_ROTANGLE is not a parameter!
If you change the rotation, an with this SYMB_ROTANGLE, the SmartPart-Framework dont' get it!

For performance-reasons we don't compare the whole scripted geometry, to decide, if two
SmartParts can (further) share the same definition.Here counts the following logic:
Same Script and same parameters results in same geometry! So Script and parameters are hashed, and
if the hashes are equal, also the geometries are equal!

For the plotted example the hashes would be equal, so both SmartParts are treated as "same",
and can further share the definition! Both SmartParts would change the geometry!
That is not, what you expect!

The definition of "same" is very important to modify copies of SmartParts (also Windows/Doors) together.
The lost of this functionality we cannot accept, because we have no multiple edit function for SmartParts!

A possible solution could be, to create an parameter für this, e.g. ref_rot.
If this Parameter exist in parameter-list, then the rotation-angle is set with the correct value at SmartPart-Refresh.
But you have to start the refresh manually after rotating the smartpart! This limitation makes it error-prone.
If you can live with this Limitation, you can write to Anja, and try to get it...

We agree.
SYMB_ROT and SYMB_POS are not parameters. (today there is an error when you use them...)
They are only "status", like SYMB_MIRRORED.

Getting the position and rotation of the SmartPart in the drawing could be very useful to analyse where are other ones and then if they are "connected" or not. For this, getting the "Allright_Comp_ID" or any other unique ID could be perfect.
It's why I asked (without any answer or result) to get the value of all the attributes in the SmartPart, not only those with "visible" and "modify" on True. The link between a parameter and an attribute is very nice. Having the same procedure as for Text1 for all parameters would be perfect!
So, I'm going to make again my request...

Have a nice day.


...how will you get the position of other Smartparts with the SYM_ROTANGLE-Parameter and Coordinates? Thats completely impossible! For this, you have to made a Data-Base-Query for all Smartparts near to the current one! For Performance Reasons, that cannot be implemented...

Hi Jörg,
I didn't say that I get the position of other SmartParts by SYMB_ROT and SYMB_POS. These both commands are not working!
My request is to get for each SmartPart its own position, its own rotation and its own internal ID. That's all!
The rest is my business... ;) There is not only the way you describe to get what I would like.
Fortunately, the users can make things that the programmers didn't imagine...
Fortunately too, the developers can improve their product to offer more possibilities to the users...
Thank you.