.NET

.NET

Reply
Active Contributor
dnlo
Posts: 45
Registered: ‎04-11-2003
Message 1 of 3 (229 Views)

Extracting Line properties from selection set, C# via COM

229 Views, 2 Replies
04-05-2006 02:09 AM
Hello,
I'm using ActiveX methods from C#. I have a selection set of AcadLine entities and need to access their StrartPoint, EndPoint values. I get an object in selection set and trying to cast to AcadLine, then access its values. The code compiles, but at runtime have an error, saying the object referenced has not been instantiated. What is the problem?
How to get AcadLine properties from selection set?
Thanks in advance.
*Tony Tanzillo
Message 2 of 3 (229 Views)

Re: Extracting Line properties from selection set, C# via COM

04-05-2006 03:33 AM in reply to: dnlo
Are you expecting someone to guess what your code
isn't doing correctly?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

wrote in message news:5132413@discussion.autodesk.com...
Hello,
I'm using ActiveX methods from C#. I have a selection set of AcadLine entities and need to access their StrartPoint, EndPoint values. I get an object in selection set and trying to cast to AcadLine, then access its values. The code compiles, but at runtime have an error, saying the object referenced has not been instantiated. What is the problem?
How to get AcadLine properties from selection set?
Thanks in advance.
Active Contributor
dnlo
Posts: 45
Registered: ‎04-11-2003
Message 3 of 3 (229 Views)

Re: Extracting Line properties from selection set, C# via COM

04-05-2006 05:27 AM in reply to: dnlo
Sorry,
the code is something like that:

for (...)
{
AcadEntity objInSset = sSetAllObjects((object) i);// sSetAllObject - selection set

AcadLine lineInSset;
lineInSset =(AcadLine)objInSset();
SomeDynamicArray.Add(lineInSset.Endpoint);//here is the problem

}
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.