I'm trying to figure out a way to rotate points about the Z axis onto the ZX plane. These points are generated on a CMM and imported into inventor via an .iges file. The part is round, so the z axis is center of rotation. I would like to write a macro that I can execute every time I import an .iges file. I have attached a file of the points and screenshot. I'm trying to rotate the pink points to the zx plane to close the profile on the yellow points.
thanks
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Here is a fairly simple iLogic rule I just created that seemed to work OK to accomplish this task on the sample file provided. There must have been a ton of points to move, because it seemed like it took at least 30 seconds to complete the task. If you need this in VBA instead of iLogic, just let me know.
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oTrans As Transaction = ThisApplication.TransactionManager.StartTransaction(oPDoc, "Rotate Points")
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oMea As MeasureTools = ThisApplication.MeasureTools
Dim oZAxis As WorkAxis = oPDef.WorkAxes.Item("Z Axis")
Dim oXZPlane As WorkPlane = oPDef.WorkPlanes.Item("XZ Plane")
Dim o3DSketch As Sketch3D = oPDef.Sketches3D.Item(1)
For Each oPt3d As SketchPoint3D In o3DSketch.SketchPoints3D
If oPt3d.Geometry.Y = 0 Then Continue For
'measure distance point is from Z-Axis
'Dim oDist As Double = oMea.GetMinimumDistance(oZAxis, oPt3d, InferredTypeEnum.kInferredLine, InferredTypeEnum.kInferredPoint)
Dim oDist As Double = oMea.GetMinimumDistance(oZAxis, oPt3d)
Dim oNewPoint As Point = ThisApplication.TransientGeometry.CreatePoint(oDist, 0, oPt3d.Geometry.Z)
oPt3d.MoveTo(oNewPoint)
Next
oTrans.End
oPDoc.Update
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.
If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb: or you can Explore My CONTRIBUTIONS
Wesley Crihfield
(Not an Autodesk Employee)
Thanks for your help. This rule worked and your right, it takes a little bit of time. Way better than what I was having to do. We have another macro that I can run to reduce the number of points. I tried this ilogic rule on a couple of parts with success.
Thanks again
Can't find what you're looking for? Ask the community or share your knowledge.