Visual Basic Customization

## Visual Basic Customization

*ljb
Message 1 of 5 (624 Views)

# convert Ellipse to polyline

624 Views, 4 Replies
06-03-2005 11:08 AM
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
Please use plain text.
*GPaolo
Message 2 of 5 (624 Views)

# Re: convert Ellipse to polyline

06-05-2005 11:45 PM in reply to: *ljb
Try this.

I hope that this is tat you need.

Ciao

GPaolo

Function HMelliarc(ByVal SemiAxisMajor As Double, ByVal SemiAxisMinor As

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

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
Please use plain text.
*Laurie Comerford
Message 3 of 5 (624 Views)

# Re: convert Ellipse to polyline

06-06-2005 11:51 PM in reply to: *ljb
Hi,

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

--

Regards,

Laurie Comerford

"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

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

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
Please use plain text.
*GPaolo
Message 4 of 5 (624 Views)

# Re: convert Ellipse to polyline

06-07-2005 12:35 AM in reply to: *ljb
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

"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

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

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
Please use plain text.
*ljb
Message 5 of 5 (624 Views)

# Re: convert Ellipse to polyline

06-07-2005 05:19 AM in reply to: *ljb
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
Please use plain text.

### You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

### Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Recently Solved