Jump to content

export and import 'negative' polyline

Recommended Posts

Hello forum,


I have a polyline object with another polyline cut out of it. If I traverse the poly in vectorscript with vertexNum and GetPolylineVertex I only get the surrounding points, not the one that make the cut out part.

How do I get to this part of the polyline?



Schermafbeelding 2020-01-15 om 13.35.52.png

Share this post

Link to post

Thank you Joshua, strange I didn't see that before...


I have another question for the creation of a polygon and or polyline:

with getObjectVariableInt (h, 696) I get the fill type of the polygon.

If I want to set the type with  setObjectVariableInt (h1, 696, str2num(s)) where s is "2" for a solid color I get an error that constant 696 is not supported for the handle. h1 points to a kpolylinenode.


Can someone please help me with how to set the fill type?

Share this post

Link to post

Hello Raymond,

695 works ok! The confusion is style vs type...


I am building a way to select items in a drawing, export these to a text file and reproduce the drawing from the text file. The text is stored in a database and I can be selected from the database to add to a drawing, to add details to the main drawing.


Creating an arc can be done 2 different ways but I think center and radius is the easiest. Does anyone have a solution to get the radius of a drawing. I must be again missing something, but I can't find a objectvar or procedure to get it...

Share this post

Link to post

You may want to try File>Export>Script. This will show you what data gets set via direct function call verses object variables. For most Set... commands there is a corresponding Get... command. 

Typically you want to look at the function reference first, and only look at object variables when they are not otherwise obtainable with a command. 

This is a little less obvious with an arc. You can use Get2DPt to get the center (index 1) and a point on the arc (index 2) and calculate the radius. http://developer.vectorworks.net/index.php/VS:Get2DPt

Share this post

Link to post

@hagemeijer ,

   If you have a handle to an ARC (or CIRCLE) object, you can't GET the radius directly, but you can calculate it:

      GetArc(H, Start, Sweep);
      Radius := hPerim(H) / Deg2Rad(Sweep);

where "H" is the handle to the object.


OR as Josh says:

    Get2DPt(H, 1, Pc.x, Pc.y);
    Get2DPt(H, 2, P1.x, P1.y);
    Radius := Norm(P1-Pc);

where "H" is a Handle to the object and Pc and P1 are Vectors.



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.

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