lucioing Posted April 7, 2017 Share Posted April 7, 2017 (edited) Maybe, something's wrong. Of course the objects created (path & sect) works fine using them in main window... The handles works fine... Thank you L. Here's the simple code: PROCEDURE Prova_Porta_01; CONST {capitalized to distinguish them from variables} VAR s:STRING; i:INTEGER; sp:REAL; base:REAL; altezza:REAL; SectObjectHandle:Handle; PathObjectHandle:Handle; FrameObjectHandle:Handle; PROCEDURE DrawSection(s: REAL); BEGIN ClosePoly; Poly( 0,0, 0,3, 3,3, 3,s, { coordinate assolute } -6,s, -6,0 ); SectObjectHandle:=LNewObj; END; PROCEDURE DrawPath(b: REAL; h:REAL); BEGIN {Relative;} OpenPoly; BeginPoly3D; Add3DPt(3,3,0); Add3DPt(3,3,h); Add3DPt(3+b,3,h); Add3DPt(3+b,3,0); EndPoly3D; PathObjectHandle:=LNewObj; END; PROCEDURE MakeFrame(h1, h2: HANDLE); BEGIN FrameObjectHandle:=CreateExtrudeAlongPath(h1,h2); END; BEGIN sp:=Ps; base:=Pb; altezza:=Ph; DrawSection(sp); DrawPath(base, altezza); MakeFrame(PathObjectHandle, SectObjectHandle); {FrameObjectHandle:=ExtrudeAlongPath(PathObjectHandle, SectObjectHandle); } it doesn't works too {Move3DObj(SectObjectHandle, 50,0,0); moving does works fine, so it's mean that the handle works Move3DObj(PathObjectHandle, 50,0,50);} END; Run(Prova_Porta_01); Edited April 7, 2017 by lucioing Quote Link to comment
JBenghiat Posted April 7, 2017 Share Posted April 7, 2017 Your path needs to be a NURBS curve. See http://developer.vectorworks.net/index.php/VS:ExtrudeAlongPath Quote The path argument must be a handle to a NURBS Curve object (type 111). The profile argument must be a handle to an object of one of the following types: NURBS Curve, Polygon, Polyline, Arc, Rectangle, Rounded Rectangle, Line, Oval. ConvertToNURBS() should do the trick. -Josh Quote Link to comment
lucioing Posted April 7, 2017 Author Share Posted April 7, 2017 Thank you Josh! I've just try this and it does works. L. PROCEDURE Prova_Porta_01; CONST {capitalized to distinguish them from variables} LOCAL_GREETING_ENGLISH = 'Hello '; LOCAL_GREETING_FRENCH = 'Bonjour '; VAR s:STRING; i:INTEGER; sp:REAL; base:REAL; altezza:REAL; SectObjectHandle:Handle; PathObjectHandle:Handle; FrameObjectHandle:Handle; PROCEDURE DrawSection(s: REAL); BEGIN ClosePoly; Poly( 0,0, 0,3, 3,3, 3,s, { coordinate assolute } -6,s, -6,0 ); SectObjectHandle:=LNewObj; END; PROCEDURE DrawPath(b: REAL; h:REAL); BEGIN {Relative;} OpenPoly; BeginPoly3D; Add3DPt(3,3,0); Add3DPt(3,3,h); Add3DPt(3+b,3,h); Add3DPt(3+b,3,0); EndPoly3D; PathObjectHandle:=LNewObj; END; PROCEDURE MakeFrame(h1, h2: HANDLE); BEGIN FrameObjectHandle := CreateCustomObjectPath('Extrude Along Path', h1, h2); <<<-------------------- END; BEGIN sp:=Ps; base:=Pb; altezza:=Ph; DrawSection(sp); DrawPath(base, altezza); MakeFrame(PathObjectHandle, SectObjectHandle); END; Run(Prova_Porta_01); 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.