.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD 2010, .NET, SelectionSets and XData

1 REPLY 1
Reply
Message 1 of 2
not.testee
337 Views, 1 Reply

AutoCAD 2010, .NET, SelectionSets and XData

Hello,

When working with Selection Sets, given the Objectid such as for a 'Selected on Screen Line', can you get the XData such as the Start Point and the End Point of the Line? I am becoming more familiar with the AutoCAD API but I am still a beginner.

The other question, if you can help or fill me in on it, is that each graphical object, such as a Line, has properties associated with it which include the Line Start Point and End Point. How do you get this information, change it, and then use AppendItem to change the Line in the drawing?

Are there other good references besides what Autodesk has made available?

THX,
golfy
1 REPLY 1
Message 2 of 2
arcticad
in reply to: not.testee

You will need to get the correct object type.

{code}
Sub ModifyLine(ByRef tr As Transaction, ByVal objID As ObjectId)
Dim e As Entity = tr.GetObject(objID, OpenMode.ForRead)
If TypeOf e Is Line Then
Dim l As Line = tr.GetObject(objID, OpenMode.ForWrite)
Dim sPt As New Point3d(0, 0, 0)
Dim ePt As New Point3d(1, 1, 0)
l.StartPoint = sPt
l.EndPoint = ePt
End If
End Sub
{code}

Then commit your transaction at the end to save the changes.
---------------------------



(defun botsbuildbots() (botsbuildbots))

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost