| |  | Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für CATIA & Co. | | |  | Dassault PLM Integrationen mit der 3DViewStation, eine Pressemitteilung
|
Autor
|
Thema: Achsensystem Selektion, Achsenreferenzen (2253 mal gelesen)
|
MarcDe Mitglied
 
 Beiträge: 137 Registriert: 11.10.2006 CATIA R18 SP2, BN 18, HF 162 Win 7 64Bit
|
erstellt am: 11. Nov. 2009 10:55 <-- editieren / zitieren --> Unities abgeben:         
Hallo Profis, ich habe schon wieder ein komisches Problem. Ich selektiere mit folgender Methode ein Achsensystem: Code:
public bool getCPDAxisSystem() { try { partDocument1 = (PartDocument)oCATIA.ActiveDocument; string e = "", msg = "Select the CPD-Axis-System.\n\n" + "The selection must be performed in document: " + Catia.activeDocumentName; object[] oType = new object[1]; oType[0] = "AxisSystem"; Selection oSel = partDocument1.Selection; oSel.Clear(); MessageBox.Show(msg, MyAssemblyInfos.AssemblyProduct, MessageBoxButtons.OK, MessageBoxIcon.Information); e = oSel.SelectElement2(oType, ref msg, false); if (e == "Normal") { axisSystem_CPD = (AxisSystem)oSel.Item(1).Value; partDocument1 = (PartDocument)oSel.Item(1).Document; part1 = partDocument1.Part; hybridShapeFactory_rootPart = (HybridShapeFactory)part1.HybridShapeFactory; } return true; } catch { return false; }; }
axisSystem_CPD ist vom Datentyp "AxisSystem". Im Nachfolgenden brauche ich von dem selektierten Achsensystem die Referenz auf die einzelnen Achsen. Das Objekt bzw die Klasse AxisSystem liefert dafür schon vorgefertigte Attribute z. B.: axisSystem_CPD.ZAxisDirection Jetzt das Problem: Selektiert der benutzter ein totes Achsensystem können die DirectionReferences nicht mehr bestimmt werden und es kommt zum Fehler. Die Frage: Wie kriege ich die Referenzen auf die einzelnen Achsen von einem toten Achsensystem, welches der Benutzter selektiert hat? Vielen dank Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
pittyplatsh Mitglied

 Beiträge: 62 Registriert: 27.12.2008 CATIA V5 R16 SP3
|
erstellt am: 11. Nov. 2009 19:32 <-- editieren / zitieren --> Unities abgeben:          Nur für MarcDe
Code: Property Type( ) As CATAxisSystemMainType Returns or sets the type of the axis system. Sets the axis system type. Values: catAxisSystemStandard = 0 Specifies that the axis system is defined by an origin point and three axes catAxisSystemAxisRotation = 1 Specifies that the axis system is defined by an origin point, and a rotation around one axis catAxisSystemEulerAngles = 2 Specifies that the axis system is defined by an origin point, and the three Euler angles catAxisSystemExplicit= 30 Specifies that the axis system is a datum.
Wechsel zum Typ Standard, lies deine Daten aus und setz das Achsensystem wieder auf Explixit Liebe Grüße, pitty Edit: Grade mal getestet. Du kannst dir bei einem Datum-Objekt die Vektoren der Achsen auch ohne Typenwechsel auslesen. Alle anderen Referenzen sind ja gebrochen wurden. Code: GetEulerAngles Returns the Euler Angles of an axis system. GetOrigin Returns the coordinates X,Y,Z of the origin point of the axis system. GetVectors Returns the coordinates X,Y,Z of the axes X and Y of the axis system. GetXAxis Returns the coordinates X,Y,Z of the X axis of the axis system. GetYAxis Returns the coordinates X,Y,Z of the Y axis of the axis system. GetZAxis Returns the coordinates X,Y,Z of the Z axis of the axis system.
Die Referenzen, wie Linien, Ebenen und Punkte kriegst du nicht mehr. Das Datum-Objekt hat ja denn Sinn alle Referenzen zu brechen und somit unabhängig existieren zu können. Würde noch eine Referenz auf andere Objekte existierten hättest du die gleichen Probleme damit wie mit einem "normalem" Objekt. [Diese Nachricht wurde von pittyplatsh am 11. Nov. 2009 editiert.] Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
| Anzeige.:
Anzeige: (Infos zum Werbeplatz >>)
 |