Newbie 2 Problems c#

Newbie 2 Problems c#

Anonymous
Not applicable
568 Views
3 Replies
Message 1 of 4

Newbie 2 Problems c#

Anonymous
Not applicable
I'm using c#
I have 2 problems
1) I want to draw an arc using (3 points) rather than start angle and the end angle provided by method "AddArc" :
Autodesk.AutoCAD.Interop.Common.AcadModelSpaceClass.AddArc(object, double, double, double)

2)I want to know how to interact with the user's selection

e.g: let the user select 2 lines and give me a value then I'll do some calculations based on the lines selected and that value and I'll modify the current drawing based on the calculations i did.

please Help 😞
0 Likes
569 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
The constructor for Geometry.CircularArc3D has an overload for three points.

Read through the labs for ObjectArx, they will show you how to get user selections (which is an ObjectID) and get the entity from a transaction, from here you can use the properties to develop your program.

Go to http://arxdummies.blogspot.com/2005/01/welcome.html
or http://usa.autodesk.com/adsk/servlet/item?siteID=123112&id=773180
0 Likes
Message 3 of 4

Anonymous
Not applicable
Thank you 🙂
0 Likes
Message 4 of 4

jbooth
Advocate
Advocate
As previously stated, the Autodesk.AutoCAD.Geometry.CircularArc2d class has a constructor overload that you can use to create your arc.

Therefore you can create a new CircularArc2d object using your three points, and pass its radius, startangle, endangle, and centre into your AcadModelSpace.AddArc() method via COM interop.

However you will need to create a .NET dll and netload it into AutoCAD before you can use namespaces like AcDb or AcGe in your code. This is the more difficult part, but there should be other threads in this forum with that information.

I honestly don't remember how to do it myself, since I haven't needed to create a new project in a while (2 years).
0 Likes