lucioing Posted July 26, 2023 Share Posted July 26, 2023 Hi! I draw a poly by Poly( .... ); then I store it in 'MyPolyHandle' by MyPolyHandle:=LNewObj; Ok. Now, can I draw the poly by its Handle? Thank you L. Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 what I mean... PROCEDURE MakeBeam(hSez: HANDLE; xtrd:REAL); BEGIN BeginXtrd(0, xtrd); somethings to put here! EndXtrd; END; Quote Link to comment
Pat Stanford Posted July 26, 2023 Share Posted July 26, 2023 I don't think I understand the question. The Poly(...); command by itself will draw the polygon when the script runs. You don't need the handle for that. If you are asking if you can get a handle to the polygon you just generated and use it inside the Xtrd command then I think the answer is yes. Or are you asking a different question? Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 7 minutes ago, Pat Stanford said: If you are asking if you can get a handle to the polygon you just generated and use it inside the Xtrd command then I think the answer is yes. You perfectly understand what I mean. Thank you, Pat L. Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 Of course, I could simply write: PROCEDURE MakeBeam(xtrd:REAL); BEGIN BeginXtrd(0, xtrd); Cerchio(0, 0, 100); EndXtrd; END; but it doesn't make sense. what I'd like to get is send to the xtrd procedure, the proper sectionProfile... So if I have to make a tube, I'll send a 'CircleSection' or a 'WebSection' or a 'TubeSection'... Quote Link to comment
Pat Stanford Posted July 26, 2023 Share Posted July 26, 2023 Hopefully the code below will give you come ideas. You could use IF instead of CASE also I think. Procedure Test; VAR N1 :Integer; Procedure MyPoly; BEGIN BeginPoly; MoveTo(0,0); CUrveTo(2,5); LineTo(10,5); LineTo(10,-5); CurveTo(8,0); LineTo(0,0); EndPoly; End; BEGIN N1:=IntDialog('Enter value 1-3 for Extrude Type','1'); BeginXtrd(0,10'); Case N1 Of 1:Rect(0,0,5,5); 2:ArcByCenter(0,0,5,0,260); 3:MyPoly; End; EndXtrd; End; Run(Test); Procedure Test; VAR N1 :Integer; Procedure MyPoly; BEGIN BeginPoly; MoveTo(0,0); CUrveTo(2,5); LineTo(10,5); LineTo(10,-5); CurveTo(8,0); LineTo(0,0); EndPoly; End; BEGIN N1:=IntDialog('Enter value 1-3 for Extrude Type','1'); BeginXtrd(0,10'); Case N1 Of 1:Rect(0,0,5,5); 2:ArcByCenter(0,0,5,0,260); 3:MyPoly; End; EndXtrd; End; Run(Test); 1 Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 Ok. You are the greatest! Simply and efficient! Thank you Pat! L. Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 One more thing... 😉 How do you PASTE the code? L. Quote Link to comment
lucioing Posted July 26, 2023 Author Share Posted July 26, 2023 I mean the 'courier' code... Quote Link to comment
Pat Stanford Posted July 26, 2023 Share Posted July 26, 2023 When you have the editor open, click the <> icon in the menu bar. It will give you a code block editor. This is critical for pasting code as it respects white space so you can paste indented code so it is easier to read. Similarly, if you click the quote icon it will quote the copied text. 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.