maarten. Posted July 30, 2008 Share Posted July 30, 2008 A good day to you all I have a Path-Pio. I let the pio make the path smaller and if there's a certain Line-Pio that "cuts" trough the pio, the poly will be parted in two (so that way there can be more then one polys in that PIO. (this was just some background information, it has nothing to do with the problem i'm having) Now i want to extrude those polys, but it doesn't work for some reason. I don't think there's something wrong with that part the code 'cause when i do it in a document based script, it works fine. Here's the code for the document based script: PROCEDURE Test; CONST AfwOn = 12.5mm; VAR PioPad : HANDLE; PioPoly : HANDLE; polyHand : HANDLE; afwOnH : HANDLE; PROCEDURE AwerkingBovenOnder(Hand : HANDLE); BEGIN afwOnH:=HExtrude(Hand,0,AfwOn); END; BEGIN poly(0,0,0,200,150,200,150,0,0,0); pioPad:=LNewObj; PioPoly:=CreateDuplicateObject(pioPad,polyHand); AwerkingBovenOnder(PioPoly); END; RUN(Test); This works. The poly get extruded. But if i do the same principle in the Path-Pio, it doesn't work... Here's The code of the Path-Pio: PROCEDURE Test; CONST AfwOn = 12.5mm; VAR {pio} pioNaam : STRING; pioHandle : HANDLE; pioRecord : HANDLE; pioMuur : HANDLE; PioPad : HANDLE; PioPoly : HANDLE; polyHand : HANDLE; afwOnH : HANDLE; PROCEDURE AwerkingBovenOnder(Hand : HANDLE); BEGIN afwOnH:=HExtrude(Hand,0,AfwOn); END; BEGIN {$debug} IF GetCustomObjectInfo(pioNaam,pioHandle,pioRecord,pioMuur) THEN BEGIN pioPad:=GetCustomObjectPath(pioHandle); PioPoly:=CreateDuplicateObject(pioPad,polyHand); BEGIN AwerkingBovenOnder(PioPoly); END; END; END; RUN(Test); And in attachment is the Path-Pio file. As you can see in the Debugger, the Handle afwOnH remains empty. The Handle Hand isn't empty though... Anybody an idea what i do wrong? Quote Link to comment
Vectorworks, Inc Employee klinzey Posted July 31, 2008 Vectorworks, Inc Employee Share Posted July 31, 2008 It looks like you are creating the duplicate object and placing it inside of the "polyHand" container. You should be creating the duplicate inside the "pioHandle" If "polyHand" is NIL it should place the duplicate in the PIO, but try using "pioHandle" to be sure. Check the object type before you extrude and make sure the source object is what you expect and not NIL. As a test just try duplicateing the object from the path without extruding it. Quote Link to comment
maarten. Posted July 31, 2008 Author Share Posted July 31, 2008 Thanks for the reply Kevin, I appreciate that a lot! I've changed that line into PioPoly:=CreateDuplicateObject(pioPad,pioHandle); as you suggested. But it still didn't worked. So I stripped down the script to it's minimum. I made a duplicate of PioPoly. To make sure the poly got duplicated, i moved that duplicate a little bit to the right and gave that duplicate a blue fill. Then i extruded that duplicate. So, the poly gets duplicated, it gets moved and it gets it's fill... But it still wouldn't extrude :crazy: When i convert that pio to a group, it shows 2 polys (the one i've drawn and the duplicate (with blue fill)), so i think that that part is correct, no. Here's the code again: PROCEDURE Test; VAR pioNaam : STRING; pioHandle : HANDLE; pioRecord : HANDLE; pioMuur : HANDLE; PioPad : HANDLE; PioPoly : HANDLE; DupliHand : HANDLE; ExtruHand : HANDLE; BEGIN IF GetCustomObjectInfo(pioNaam,pioHandle,pioRecord,pioMuur) THEN BEGIN pioPad:=GetCustomObjectPath(pioHandle); PioPoly:=CreateDuplicateObject(pioPad,pioHandle); DupliHand:=HDuplicate(PioPoly,200mm,0); SetFPat(DupliHand,1); SetFillBack(DupliHand,0,43690,65535); ExtruHand:=HExtrude(DupliHand,0,50mm); END; END; RUN(Test); 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.