VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

convert Ellipse to polyline

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
1051 Views, 4 Replies

convert Ellipse to polyline

I need to convert an ellipse to a polyline in AutoCAD 2000 vba but an
ellipse can't be exploded. When AutoCAD 2000 saves the ellipse as an r12 DXF
it is converted to a 3d-polyline. How do I do the same?

Set sset = .SelectionSets.Add("ConvertEllipse")

grpCode(0) = 0: grpValue(0) = "ellipse"
sset.Select acSelectionSetAll, , , grpCode, grpValue
If sset.Count > 0 Then
For Each ssItem In sset

If ssItem.ObjectName = "AcDbEllipse" Then ????

Next
End If


thanks
LJB
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

Try this.

I hope that this is tat you need.

Ciao

GPaolo





Function HMelliarc(ByVal SemiAxisMajor As Double, ByVal SemiAxisMinor As
Double)AS AcadLWPolyline

Dim LWpoly As AcadLWPolyline

Dim I As Integer

Dim J As Integer

Dim SinArc As Double

Dim aini As Double

Dim afin As Double

Dim Pnt(2) As Double

Dim Center(2) As Double

Dim Rapp As Double

Dim Vertex(2162) As Double

Dim MyInd As Long = -1

aini = 0.0

afin = TwoPI()

SinArc = afin / 720.0

Rapp = SemiAxisMinor / SemiAxisMajor

'*******************************************************

'''''''' G E S T I O N E E L L I S S I

'*******************************************************

For J = 0 To 720

Pnt(0) = (SemiAxisMajor * Cos(aini))

Pnt(1) = (SemiAxisMajor * Sin(aini)) * Rapp

Pnt(2) = 0.0

MyInd += 1

Vertex(MyInd) = Pnt(0)

MyInd += 1

Vertex(MyInd) = Pnt(1)

MyInd += 1

Vertex(MyInd) = Pnt(2)

aini += SinArc

Next J

LWpoly=THISDRAWING.MODESSPACE.ADDLWPOLYLINE .........

HMELLIARC=LWpoLY

END FUNCTION

"ljb" <.> ha scritto nel messaggio news:4865118@discussion.autodesk.com...
I need to convert an ellipse to a polyline in AutoCAD 2000 vba but an
ellipse can't be exploded. When AutoCAD 2000 saves the ellipse as an r12 DXF
it is converted to a 3d-polyline. How do I do the same?

Set sset = .SelectionSets.Add("ConvertEllipse")

grpCode(0) = 0: grpValue(0) = "ellipse"
sset.Select acSelectionSetAll, , , grpCode, grpValue
If sset.Count > 0 Then
For Each ssItem In sset

If ssItem.ObjectName = "AcDbEllipse" Then ????

Next
End If


thanks
LJB
Message 3 of 5
Anonymous
in reply to: Anonymous

Hi,

Before proceeding further with your programming here, you may care to study
the "pellipse" system variable.


--

Regards,


Laurie Comerford
www.cadapps.com.au

"GPaolo" wrote in message
news:4865982@discussion.autodesk.com...
Try this.

I hope that this is tat you need.

Ciao

GPaolo





Function HMelliarc(ByVal SemiAxisMajor As Double, ByVal SemiAxisMinor As
Double)AS AcadLWPolyline

Dim LWpoly As AcadLWPolyline

Dim I As Integer

Dim J As Integer

Dim SinArc As Double

Dim aini As Double

Dim afin As Double

Dim Pnt(2) As Double

Dim Center(2) As Double

Dim Rapp As Double

Dim Vertex(2162) As Double

Dim MyInd As Long = -1

aini = 0.0

afin = TwoPI()

SinArc = afin / 720.0

Rapp = SemiAxisMinor / SemiAxisMajor

'*******************************************************

'''''''' G E S T I O N E E L L I S S I

'*******************************************************

For J = 0 To 720

Pnt(0) = (SemiAxisMajor * Cos(aini))

Pnt(1) = (SemiAxisMajor * Sin(aini)) * Rapp

Pnt(2) = 0.0

MyInd += 1

Vertex(MyInd) = Pnt(0)

MyInd += 1

Vertex(MyInd) = Pnt(1)

MyInd += 1

Vertex(MyInd) = Pnt(2)

aini += SinArc

Next J

LWpoly=THISDRAWING.MODESSPACE.ADDLWPOLYLINE .........

HMELLIARC=LWpoLY

END FUNCTION

"ljb" <.> ha scritto nel messaggio news:4865118@discussion.autodesk.com...
I need to convert an ellipse to a polyline in AutoCAD 2000 vba but an
ellipse can't be exploded. When AutoCAD 2000 saves the ellipse as an r12 DXF
it is converted to a 3d-polyline. How do I do the same?

Set sset = .SelectionSets.Add("ConvertEllipse")

grpCode(0) = 0: grpValue(0) = "ellipse"
sset.Select acSelectionSetAll, , , grpCode, grpValue
If sset.Count > 0 Then
For Each ssItem In sset

If ssItem.ObjectName = "AcDbEllipse" Then ????

Next
End If


thanks
LJB
Message 4 of 5
Anonymous
in reply to: Anonymous

It's correct.
But in this way you cannot decide the value of chord heigth tollerance .
With this programm i can draw an ellipse with an high number of vertex and
then with another programm i read the vertex and i can draw the ellipse with
arc.

Ciao

"Laurie Comerford" ha scritto nel
messaggio news:4867123@discussion.autodesk.com...
Hi,

Before proceeding further with your programming here, you may care to study
the "pellipse" system variable.


--

Regards,


Laurie Comerford
www.cadapps.com.au

"GPaolo" wrote in message
news:4865982@discussion.autodesk.com...
Try this.

I hope that this is tat you need.

Ciao

GPaolo





Function HMelliarc(ByVal SemiAxisMajor As Double, ByVal SemiAxisMinor As
Double)AS AcadLWPolyline

Dim LWpoly As AcadLWPolyline

Dim I As Integer

Dim J As Integer

Dim SinArc As Double

Dim aini As Double

Dim afin As Double

Dim Pnt(2) As Double

Dim Center(2) As Double

Dim Rapp As Double

Dim Vertex(2162) As Double

Dim MyInd As Long = -1

aini = 0.0

afin = TwoPI()

SinArc = afin / 720.0

Rapp = SemiAxisMinor / SemiAxisMajor

'*******************************************************

'''''''' G E S T I O N E E L L I S S I

'*******************************************************

For J = 0 To 720

Pnt(0) = (SemiAxisMajor * Cos(aini))

Pnt(1) = (SemiAxisMajor * Sin(aini)) * Rapp

Pnt(2) = 0.0

MyInd += 1

Vertex(MyInd) = Pnt(0)

MyInd += 1

Vertex(MyInd) = Pnt(1)

MyInd += 1

Vertex(MyInd) = Pnt(2)

aini += SinArc

Next J

LWpoly=THISDRAWING.MODESSPACE.ADDLWPOLYLINE .........

HMELLIARC=LWpoLY

END FUNCTION

"ljb" <.> ha scritto nel messaggio news:4865118@discussion.autodesk.com...
I need to convert an ellipse to a polyline in AutoCAD 2000 vba but an
ellipse can't be exploded. When AutoCAD 2000 saves the ellipse as an r12 DXF
it is converted to a 3d-polyline. How do I do the same?

Set sset = .SelectionSets.Add("ConvertEllipse")

grpCode(0) = 0: grpValue(0) = "ellipse"
sset.Select acSelectionSetAll, , , grpCode, grpValue
If sset.Count > 0 Then
For Each ssItem In sset

If ssItem.ObjectName = "AcDbEllipse" Then ????

Next
End If


thanks
LJB
Message 5 of 5
Anonymous
in reply to: Anonymous

I checked out the PELLIPSE system variable. Changing the value doesn't have
any affect on an ellipse already drawn. Changing the value only affects
those drawn after.

thanks
LJB

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost