WhoCanDo Posted April 2, 2015 Share Posted April 2, 2015 I want to create a pipe using Extrude Along Path as I can with the option from the "Model" menu but after trying several variations I can't get the Extrusion working. Any ideas anyone? After running the following macro I can use the "Model/Extrude Along Path" manually and it creates exactly what I want but I can't find a procedure that works in the macro... procedure Pipe; var h1, h2 : handle; PipeOD, Wall, p1X, p1Y, p1Z, p2X, p2Y, p2Z : real; begin PipeOD := 42.4; Wall := 3.2; Message ('Pick first and last points.'); GetLine3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z, false); Poly3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z); h1 := ConvertToNurbs (LNewObj, false); Oval (-PipeOD/2, PipeOD/2, PipeOD/2, -PipeOD/2); Oval (-PipeOD/2 + Wall, PipeOD/2 - Wall, PipeOD/2 - Wall, -PipeOD/2 + Wall); h2 := LNewObj; ClipSurface (PrevObj (h2), h2); DelObject (h2); { h2 := CreateCustomObjectPath ('Extrude Along Path', h1, LNewObj); } ClrMessage; end; run (Pipe); Quote Link to comment
C. Andrew Dunning Posted April 2, 2015 Share Posted April 2, 2015 Try this...: procedure Pipe; var h1, h2,h3,h4,h5 : handle; PipeOD, Wall, p1X, p1Y, p1Z, p2X, p2Y, p2Z : real; begin PipeOD := 42.4; Wall := 3.2; Message ('Pick first and last points.'); GetLine3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z, false); Poly3D (p1X, p1Y, p1Z, p2X, p2Y, p2Z); h1 := ConvertToNurbs (LNewObj, false); Oval (-PipeOD/2, PipeOD/2, PipeOD/2, -PipeOD/2); h2 := LNewObj; Oval (-PipeOD/2 + Wall, PipeOD/2 - Wall, PipeOD/2 - Wall, -PipeOD/2 + Wall); h3 := LNewObj; ClipSurface (h2, h3); h4 := PrevObj(h3); h5 := CreateCustomObject('Extrude Along Path',0,0,0); IF SetCustomObjectProfileGroup(h5,h4) THEN BEGIN END; IF SetCustomObjectPath(h5,h1) THEN BEGIN END; DelObject (h2); DelObject (h3); ClrMessage; end; run (Pipe); Quote Link to comment
WhoCanDo Posted April 2, 2015 Author Share Posted April 2, 2015 Thanks Mate, Why do they make it so difficult when DoMenuTextByName ('Extrude Along Path', 0); would have done. Regards Quote Link to comment
C. Andrew Dunning Posted April 2, 2015 Share Posted April 2, 2015 I'm glad things worked. I know things seem a bit convoluted but this is one of those times in which the coding intricacy might be needed by some users - and, this call works independently of what menu items a user might have in his/her WorkSpace. If you care to, you also have 2 other options. Look into "CreateExtrudeAlongPath" and "ExtrudeAlongPath." The latter is a newer call I haven't tried, yet, and the former actually creates 3 objects: the EAP shell and 2 end-caps. Quote Link to comment
WhoCanDo Posted April 3, 2015 Author Share Posted April 3, 2015 Yes, I can see your reasoning. CreateExtrudeAlongPath seems to take my donut profile and extrudes along the path without a hole. ExtrudeAlongPath doesn't seem to work at all. However, I couldn't get CreateCustomObjectPath to work either until you offered a solution. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.