New Member
Posts: 1
Registered: ‎11-19-2005
Message 1 of 2 (187 Views)

type (object -> AcadRegion) Conversion Error in C#

187 Views, 1 Replies
01-17-2006 04:29 AM

I'm in trouble with the following data type error :
(VS 2003, C#, AutoCAD2006)
profile[0] = (AutoCAD.AcadEntity)pline;
object region = app.ActiveDocument.ModelSpace.AddRegion(profile);
box = app.ActiveDocument.ModelSpace.AddExtrudedSolid(region[0],10,0);
I'd appreciate to your recipe.

Distinguished Contributor
Alexander Rivilis
Posts: 303
Registered: ‎09-26-2004
Message 2 of 2 (187 Views)

Re: type (object -> AcadRegion) Conversion Error in C#

03-22-2006 01:03 PM in reply to: komodors
Try this code:
Object[] regs = (Object[])app.ActiveDocument.ModelSpace.AddRegion(profile);
foreach (AcadRegion reg in regs) {
box = app.ActiveDocument.ModelSpace.AddExtrudedSolid(reg,10,0);

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.