Jump to content
SamIWas

Issue with "Extrude Along Path"

Recommended Posts

I am trying to do a very simple extrude along path in Vectorscript to basically make a square or circle tube box.   When drawing, I simply create a rectangle for the path, a rectangle or circle for the profile, and run "Extrude Along Path".

 

I have managed to get Vectorscript to make the object, but I'm running into a few problems:

1. It seems to draw these things on screen plane rather than using basic world coordinates.  I tried setting the plane, but that didn't appear to do anything.

2. It leaves the 2D objects there.

 

This is a test section of code.  It should create an 80x80 box of 2" square tube.  It does, but it is always perpendicular to the camera, and not flat on "ground level".   I tried using "SetWorkingPlace".  I know I'm doing something wrong, or leaving something out.  Any leads?

                Rect(-40,40,40,-40);
                struc1:=ConvertToNURBS(LNewObj,FALSE);
                Rect(-1,1,1,-1);
                struc2:= LNewObj;
                struct:=ExtrudeAlongPath(struc1,struc2);
                Move3DObj(struct,0,0,10);

Share this post


Link to post

Check and see if the CreateCustomObjectPath command is more to your liking. It will make a solid object instead of a bunch of surfaces.

 

It is a newer command and more likely to work they way you are asking for.

 

Share this post


Link to post
6 hours ago, Pat Stanford said:

Check and see if the CreateCustomObjectPath command is more to your liking. It will make a solid object instead of a bunch of surfaces.

 

It is a newer command and more likely to work they way you are asking for.

 

 

I couldn't figure out how to make that one work at all.  I have managed to get the strange rotation issues dealt with by using 3D polys as the path and profile instead of rectangles.  But I still can't get them to go away once the extrude is made.  I'm left with the extrude and floating polygons.

Share this post


Link to post
4 hours ago, Alan Woodwell said:

@SamIWasSeems to work in 2018 simple rectangles x 2 and EAP.

attached 2016 file to see if any issues.

HTH

EAP.vwx

 

No issues with the Extrude Along Path tool itself.  It's when I run it through Vectorscript that I can't seem to make the original shapes disappear.

Share this post


Link to post
19 hours ago, SamIWas said:

I have managed to get Vectorscript to make the object, but I'm running into a few problems:

1. It seems to draw these things on screen plane rather than using basic world coordinates.  I tried setting the plane, but that didn't appear to do anything.

2. It leaves the 2D objects there.

 

Hello Sam,

   Problem 1, either draw your 2D objects directly on the Layer (GND) Plane, or move them there after they are created.

   Problem 2, requires manual clean up.

 

I modified your script to address both problems.

PROCEDURE EAPOnGndPlane;
VAR
	struc, struc1, struc2 :Handle;
BEGIN
	Rect(-40, 40, 40, -40);
	SetObjectVariableBoolean(LNewObj, 1160, FALSE);	{ Move PathRECT to Ground Plane }
	struc1 := ConvertToNURBS(LNewObj, FALSE);
	
	Rect(-1, 1, 1, -1);
	struc2 := LNewObj;
	SetObjectVariableBoolean(struc2, 1160, FALSE);	{ Move ProfileRECT to Ground Plane }
	
	struc := ExtrudeAlongPath(struc1, struc2);
	
	Move3DObj(struc, 0, 0, 10);		{ elevate EAP }
	
	{ Clean up }
	DelObject(struc1);
	DelObject(struc2);
	
	if (struc <> nil) then SysBeep;	{ APPLAUSE!!! }
END;
Run(EAPOnGndPlane);

 

HTH,

Raymond

Share this post


Link to post

Thanks everyone for making me think.  I got it all working.  The original problem was not drawing on the "ground".  That as fixed by either using 3D polys, or using the 1160 variable.  Then, I couldn't get the polys to go away.  That was fixed with the DelObject calls, which for some strange reason, I missed.

Share this post


Link to post

Hello, by chance I stumbled upon this discussion. I know it's late but it might save a lot of searches later for others.

 

You must "flatten" the path object, you can also use SetPlanarRefIDToGround. Example:

RectangleN(x, y, 1, 0, w, h);
pathObj := LNewObj;
SetFPat(pathObj, 0); 

SetPlanarRefIDToGround(pathObj); { without this, your ExtrudeAlongPath will be extruded along any view you happen to be in }
pathObj := ConvertToNURBS(pathObj, FALSE);
obj := ExtrudeAlongPath(pathObj, profileObj); { profile object is a poly, rect, oval etc. }

 

Share this post


Link to post

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.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...