Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I know this is a common question and there are many good solutions available, but I need something a bit smaller then suggested in the topic below.
I got the code below and I would like to rotate my part just 180° around the y-axis.
I thought it would be very nice to just change the last part to;
oMatrix.SetTranslation(oTG.CreateVector(oX/10, oY/10, oZ/10, 0, PI, 0))
But this wouldn't work unfortunatly..
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisDoc.Document.ComponentDefinition Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oMatrix As Matrix = oTG.CreateMatrix Dim oOccurrence As ComponentOccurrence If Bodem = 3 Or Bodem = 4 Then Part_hight = 4 Else Part_hight = 4 + Romp_aantal End If Bodem_0punt = GoExcel.CellValue(Datasheet, Blad, "O" & Part_hight) MsgBox(Bodem_0punt & " 2 " & Romp_aantal) 'get user input - units are cm oX = 0 oY = 0 oZ = Bodem_0punt 'placement co-ordinates in mm's oMatrix.SetTranslation(oTG.CreateVector(oX/10, oY/10, oZ/10)) oOccurrence = oAsmCompDef.Occurrences.Add(Part_name, oMatrix) oOccurrence.Grounded = True
If someone has a quick and simple code then you would save me lots of time...
Solved! Go to Solution.