Hi,
I want to move a sweeping path in a 3D sketch in Z-direction.
My plan: I want to create 2 parallel pipe runs. So, my idea is, to move a path from one sweeping and move it in Z-direction.
Any idea how to do that?
Greetings
Passi
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Hi, Have you tried the 3D Transform tool?
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
@Anonymous,
Are you trying to move through Inventor API?
If so, can you please provide non confidential data to study?
Thanks and regards,
Yes, I wanted to try it via API (was my fault, to forgot it in the previous text).
Attached you'll find the example.
Left side, a simple line to move and on the right side, the wished result 🙂
(The Reply with the 3D transform was exactly what I want, but via API)
Greetings
Passi
Is it possible?
Is it possible through API?
Hi @liminma8458.
In the most basic of terms...Yes, it is possible. But it can get pretty complicated when constraints and dimensions get involved. I opened the part file that @Anonymous posted, then saved it locally to test with. Then I created a copy of the original 3D sketch to preserve the original (for comparison), while I attempted to modify the second (copied) sketch (named "3D Sketch2"). Then I measured the distance from start point to start point of the two offset paths, so I know how far to move the geometry with my code, then deleted the two offset paths, leaving just the original path for testing on. Then, In order to get the following code to work, I had to delete the few constraints that were present in the geometry first, then I ran the rule, and it worked just fine, then I could reapply the constraints to the resulting geometry. Basically all I did was create a Vector (specifies direction and distance) and used that to move each SketchPoint3D object in the whole sketch by that using that Vector. Since this example was very simple, just some connected 3D lines (each line has a SketchPoint3D at each end), the code simply moved each point by the specified direction and distance that was specified by the Vector used.
If you wanted to go another step further, you could likely catch all constraints within the code, remove them, move all the geometry, then have the code reapply all the same constraings, because they were just aligning a few lines parallel to the origin planes. But with those constraints still in place, when I move the point at one end of one of those constrained lines, it would move the whole line by that amount, then when it moved the point at the other end of the same line, it would move the whole line an additional amount, causing the geometry to loose its original shape/size. That's why I first had to eliminate those few constraints before running the rule, then reapply them later.
Here's the iLogic rule that moves (not copies) the whole connected line up in the Z-direction by the specified amount.
Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oSketch3D As Sketch3D = oPDef.Sketches3D.Item("3D Sketch2") '<<< CHANGE THIS >>>
Dim oVect As Vector = ThisApplication.TransientGeometry.CreateVector(0,0,128.25 mm)
For Each oSP3D As SketchPoint3D In oSketch3D.SketchPoints3D
oSP3D.MoveBy(oVect)
Next
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)
Yes. It works this way!
Thank you so much !
Can't find what you're looking for? Ask the community or share your knowledge.