×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How can I get polyline properties with VBA?

How can I get polyline properties with VBA?

How can I get polyline properties with VBA?

(OP)
I'm trying to find the length from one point on a polyline to another point on that polyline. The polyline is only made up of lines and arcs. The polyline.coordinates does not give me any arc information. The Autocad LIST command will give me the arc information but I can't figure out how the get it in VBA. I don't want to have to explode the polyline because then I would need to figure out the order of the separate entities. Any ideas?

RE: How can I get polyline properties with VBA?

Hi jrice174,

VBA doesn't expose this property - you'll need to do some math to calculate the lengths, and you'll need to use the point data to do it.

HTH
Todd

RE: How can I get polyline properties with VBA?

Visual lisp has an advantage here - fairly staightforward with 'vlax-curve-xxx' functions.

RE: How can I get polyline properties with VBA?

(OP)
The coordinates don't tell me if the points are for lines or arcs so there is no way to tell if it is a corner or a rounded arc. Isn't there a way to do the LIST command and get the results from the command line?

RE: How can I get polyline properties with VBA?

Well, you can do a send command but you won't be able to get the output.  Best bet is to write a quick and dirty lisp routine using the vlax-curve-xxx function Carl recommended, and have the lisp routine pump the results into one of the USERXXX variables, and then use VBA to pull it out.

HTH
Todd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources