Jump to content
Developer Wiki and Function Reference Links ×

Path PIO's


Guest

Recommended Posts

Guest Mark Flamer

I am having trouble understanding how to implement 2D and 3D path objects. I can get a path drawn, but I don't think I am using this correctly. Here is my script.

Procedure test;

VAR

hnd,path,prof,ext : Handle;

BEGIN

hnd := LObject;

path := GetCustomObjectPath(hnd);

Arc(0, 0, 1, 1, 0, 360);

prof := LNewObj;

ext := CreateCustomObjectPath('Extrude Along Path', path, prof);

END;

Run(test);

The fact that I can get a path from the last object leads me to believe that a path object has already been created and I do not need to create another one. Does anyone have any examples or additional documentation that would help explain how to best use these tools? Thanks.

Link to comment

GetCustomObjectPath returns a handle to the path object of an object already in the drawing. You would use this if you wanted to change the path of an object or to be able to duplicate it to use it in another object. Is that what you are trying to do?

CreateCustomObjectPath takes a name, and handles to two object. The first handle should be to a polygon (but I think a NURBS curve will work also) and the second to a 2D profile object.

So what you want to do is get a handle to a polygon and pass that to the CreateCustomObjectPath.

Also, I don't think you want to use that name for the Object. VW only allows one object to have a name in a file. Since Extrude Along Path is the name of a PIO type I don't think it will work for a name in this case. Something like Mark Extrude would probably be better.

There is a little more information available at http://developer.vectorworks.net/index.php?title=Category:VectorScript

Link to comment
Guest Mark Flamer

Thanks Pat. I think I understand the 2 functions you describe. What I'm not grasping is when I create a PIO, I'm given options on the type of plug-in to create. Menu, Tool, 2D Path, 3D Path ect. In this paticular instance I am creating a 3D Path type PIO. The wrapper VW provides for this type of object includes the interface for creating a Nurbs curve without any additional work by me. What I'm wondering is how to utilize the nurbs created by this preset interface. I can get the path by

hnd := LObject;

path := GetCustomObjectPath(hnd);

at the begining of my script, so I know a Path Object has been created. Does this seem like the correct way to use this 3D Path template? I'm just not clear on exactly what is happening in the background when these path object templates are used. Hope that makes sense. Thanks.

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...