Jump to content
Developer Wiki and Function Reference Links ×

HANDLE of extrusion stays empty


Recommended Posts

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?

Link to comment
  • Vectorworks, Inc Employee

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.

Link to comment

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);

Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...