Jump to content
Developer Wiki and Function Reference Links ×

export and import 'negative' polyline


hagemeijer

Recommended Posts

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?

Link to comment

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

Link to comment

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

Link to comment

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

 

Raymond

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