Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

AutoCAD VBA - Convert arc to lines 1

Status
Not open for further replies.

OUG

Mechanical
Feb 23, 2003
5
GR
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?
 
Replies continue below

Recommended for you

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


 
Oug,
Are you trying to make a flat layout of
a multi curved object? It might help if
we knew your reason.
 
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.
 
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top