.NET

.NET

Reply
New Member
NamelessDN
Posts: 2
Registered: ‎01-29-2010
Message 1 of 6 (732 Views)

Can't use function GetBoundingBox from C# application

732 Views, 5 Replies
01-29-2010 06:22 AM
Hi.
I work with Autocad from C# application using late binding.
After inserting block, i want to get its bounds.

double[] aMinPoint = new double[3], aMaxPoint = new double[3];
Params = new object[] { aMinPoint, aMaxPoint };
oBlock.GetType().InvokeMember("GetBoundingBox", BindingFlags.InvokeMethod, null, oBlock, Params);

But after execution this code aMaxPoint and aMinPoint had their default values - 0.

What do I do wrong?

By the way the same task in VB.NET (with built-in late binding) solves good.

Dim aMinPoint() As Double
Dim aMaxPoint() As Double

oBlock.GetBoundingBox(aMinPoint, aMaxPoint)

Thanks for help.
*Tony Tanzillo
Message 2 of 6 (732 Views)

Re: Can't use function GetBoundingBox from C# application

01-29-2010 10:51 PM in reply to: NamelessDN
See the sample code here:

http://www.caddzone.com/LateBoundComSample.cs


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6326932@discussion.autodesk.com...
Hi.
I work with Autocad from C# application using late binding.
After inserting block, i want to get its bounds.

double[] aMinPoint = new double[3], aMaxPoint = new double[3];
Params = new object[] { aMinPoint, aMaxPoint };
oBlock.GetType().InvokeMember("GetBoundingBox", BindingFlags.InvokeMethod, null,
oBlock, Params);

But after execution this code aMaxPoint and aMinPoint had their default values -
0.

What do I do wrong?

By the way the same task in VB.NET (with built-in late binding) solves good.

Dim aMinPoint() As Double
Dim aMaxPoint() As Double

oBlock.GetBoundingBox(aMinPoint, aMaxPoint)

Thanks for help.
New Member
NamelessDN
Posts: 2
Registered: ‎01-29-2010
Message 3 of 6 (732 Views)

Re: Can't use function GetBoundingBox from C# application

01-29-2010 11:34 PM in reply to: NamelessDN
Perfect sample, thanks.
Mentor
amitk_189
Posts: 242
Registered: ‎12-15-2011
Message 4 of 6 (441 Views)

Re: Can't use function GetBoundingBox from C# application

07-26-2012 03:19 AM in reply to: NamelessDN

Can you share a copy of part of code because am unable to find data in the link. Am also using the same concept of GetBoundingBox to Get the location of Texts.

ADN Support Specialist
Virupaksha.aithal
Posts: 101
Registered: ‎06-15-2011
Message 5 of 6 (404 Views)

Re: Can't use function GetBoundingBox from C# application

07-31-2012 02:16 AM in reply to: amitk_189

Hi

 

refer blog post http://adndevblog.typepad.com/autocad/2012/07/using-activex-api-getboundingbox-in-net.html. The post shows the use of GetBoundingBox in c#  application



Virupaksha Aithal KM
Developer Technical Services
Autodesk Developer Network

Mentor
amitk_189
Posts: 242
Registered: ‎12-15-2011
Message 6 of 6 (398 Views)

Re: Can't use function GetBoundingBox from C# application

07-31-2012 03:06 AM in reply to: NamelessDN

Hello Virupaksha.aithal, i resolved this issue quite some time ago, but stuck up in a new location. Call rejected by callee.

I have already posted a issue in the forum and side by side i am also trying to execute this, but my code gets stuck at Call rejected by callee.

 

Then if i press F5 it works as expected

 

http://forums.autodesk.com/t5/NET/Call-Rejected-by-Callee/td-p/3558826

This is the link for it

 

 

With Warm Regards

Amit

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.