Jump to content

Script Error

Recommended Posts

I have attached a file with two scripts in progress.  It is a script that I was developing to replace circles with hexagons.  The first version doesn't work as expected. It creates the hexagons but they are 1/25.40157 sized and location from the origin.  I modified the script to multiply the X,Y coordinates by 24.40157 and the size.  This places the hexagons in their proper location and size.   It seems that the script is converting the units to mm from inches. If I set the drawing units to mm the first script works

Script Error.vwx

Link to comment
6 hours ago, The Hamma said:

This modification corrects the issue but it seems to me that if the points are read from HCenter as inches then they should be passed to RegularPolygon as inches.


@The Hamma ,

   That would make perfect sense, but RegularPolygon() is one of those procedures that always takes its input as mm, and not document units. So, YES, you have to scale the  inputs to be mm before calling RegularPolygon(). Unfortunately, the documentation does not reflect that. Welcome to the quirky world of VS programming.   )



Link to comment
  • 9 months later...

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.

  • Create New...