×
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

AutoCAD VBA - Convert arc to lines

AutoCAD VBA - Convert arc to lines

AutoCAD VBA - Convert arc to lines

(OP)
Hi,
I am searching for the
b-rep subroutine that Acad uses to display the arc and circles, by
segmenting them according to their length.
Can anyone help me?

RE: AutoCAD VBA - Convert arc to lines

Oug!

Think your a little bit advanced for trying that.. did you try to use vb-forums? I find answers there regarding to programming...

sorry I can't help you.

Heyner

RE: AutoCAD VBA - Convert arc to lines

Are you looking to take the vector components of a circle or arc and convert them to smaller segments? Is this for calculation or just to represent them visually?

RE: AutoCAD VBA - Convert arc to lines

(OP)
I want this subroutine to replace the arc with small lines and afterwards i'll use the start and end point of each line for a calculation.

RE: AutoCAD VBA - Convert arc to lines

Just a thought. If you do not actually want to "break up" the arc but only use points for calculation. You can "Divide" the arc into equal vector points by using the DIVIDE command. You could then use the points to calculate from. Otherwise, you could 1)similarly create those points and then draw the segments in between each point or 2) calculate from the center, radius, and the start and end points to create a matrix of vector points to draw each segment with.

RE: AutoCAD VBA - Convert arc to lines

About using the polygon command since a circle is a polygon with an infinite number of straight sides. You can then trim portion of the polygon below the cord drawn as a straight line to identify the portion of the arc that you are interested. You may then try array "point" on the corners of the newly formed arc and use LIST to identify the positions (X,Y) of the point marks identifying the corners fo the straight sides of the arc .  Would be a good idea to relocate UCS to the center of the original polygon  before listing the locations of the points.

RE: AutoCAD VBA - Convert arc to lines

The DXF group codes for the arc that might apply for your routine are:
Arc group codes:
10    Center point (in OCS). DXF: X value; APP: 3D point
20, 30    DXF: Y and Z values of center point (in OCS)
40    Radius
50    Start angle
51    End angle

Lwpolyline group codes:
10    Vertex coordinates (in WCS), multiple entries; one entry for each vertex. DXF: X value; APP: 2D point
20    DXF: Y value of vertex coordinates (in WCS), multiple entries; one entry for each vertex
90    Number of vertices.
128 = plinegen

There also is a lisp routine called "Circle2Pline" by Jason Piercey that converts circles to polylines using lwpolines.  What it does is change a circle to a polyine, and then you will later be able to change the width of the line (you cannot change the width of a circle, and you do not have to use the donut command.
It does not work on circles, but you may want to study it and it might lead you to some ideas for your routine.

Flores


RE: AutoCAD VBA - Convert arc to lines

Oug,
Are you trying to make a flat layout of
a multi curved object?  It might help if
we knew your reason.

RE: AutoCAD VBA - Convert arc to lines

(OP)
Thanks borgunit, chicopee and smcadman i'll try them all.

diamondjim, basically i want to convert the arc,circle,spile to lines so i can use the endpoint and startpoint X,Y,Z cordinates for some calculations.

RE: AutoCAD VBA - Convert arc to lines

Hi,
Didn't want to leave you hanging. It can be written in LISP if you want. Does not sound especially hard. Contact me if you want to do something with it.

pilpro@bright.net

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