Draw a 3D Circle with VBA

Draw a 3D Circle with VBA

OceanaPolynom
Advocate Advocate
2,299 Views
5 Replies
Message 1 of 6

Draw a 3D Circle with VBA

OceanaPolynom
Advocate
Advocate

Hello

I need to use VBA to draw 3D circles in model space.  The circles are given by the center point (X Y Z), the radius, and a direction (in radians) from the center point.  I don't have much 3D experience.

 

Thank you,

John

0 Likes
Accepted solutions (1)
2,300 Views
5 Replies
Replies (5)
Message 2 of 6

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

a sample is shown in the help: >>>click<<<

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 3 of 6

OceanaPolynom
Advocate
Advocate

Hello

This will not solve my problem, but it might be the start of a solution.  The circles represent steel rings used to reinforce a tunnel as it is being constructed.  The rings must be oriented at 90 degrees to the alignment in the z direction, and at right angles to the alignment whether in a straight section or a curved section.  I have attached a file that I created using AutoCad commands.  The direction (or vector?) that is included in the input data is used to define the circular plane of the ring.

Thank you,

John

 
 
 
0 Likes
Message 4 of 6

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

>> This will not solve my problem,

That was what I was able to see from your initial post ... 😉

 

>> The rings must be oriented at 90 degrees to the alignment in the z direction

Look to the TranslateCoordinates function (>>>click<<<) as well as to the definition of user-coordinate-systems (>>>click<<<) for your circles along alignments.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 5 of 6

OceanaPolynom
Advocate
Advocate

Thank you I am working on this now

John

0 Likes
Message 6 of 6

OceanaPolynom
Advocate
Advocate

Thank you very much.  In the end I only needed to use

Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "New_UCS")

in the right way in order to draw the circles.

 

Thanks again

John

0 Likes