.NET

.NET

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

Extracting Line properties from selection set, C# via COM

225 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 (225 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 (225 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

}
Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.