Jump to content

How to get info about LWPolyline using VBA?


Recommended Posts

Posted

Hello,

 

When you enter list and select a lwpolyline you get a lot of information as; bulge, center, radius, start angle, end angle etc.

 

How can I get this information from a selected object using vba? Is it possible?

 

I know that you can calculate this information, but is there a more simple way? :) Or does anyone know of some example code?

 

Below you will find the code I got so far:

 

Any help is highly apreciated!

// Marcus

 

 

 


ThisDrawing.Utility.GetEntity oEnt, vPick, vbCr & "Select object:"

If TypeOf oEnt Is AcadLWPolyline Then

Dim MyLWPolyline As AcadLWPolyline
Set MyLWPolyline = oEnt

For lCounter = 0 To lNumberOfCoordinates
   
dNewCoordinates(lCounter) = MyLWPolyline.Coordinates(lCounter)
dNewCoordinatesBulge(lCoordpairCounter) = MyLWPolyline.GetBulge(lCoordpairCounter)
   
Next
end if

Posted

What are you trying to do rather than just getting info re lwpolyline? Someone may have already done it.

Posted
What are you trying to do rather than just getting info re lwpolyline? Someone may have already done it.

 

You are probably right! Im sure someone already have done this,

but anyway. Im trying to convert a LWPolyline with arcs, to a polyline whitout arcs (several straight lines instead). And I want to be able to select how many lines (sectors) within the arc to use, depending on the bulge and radie. And I have actually suceeded! Whith a lot of math!

 

Thanks anyway!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...