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

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

190 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 (190 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);

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!