.NET

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

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

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

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.

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

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

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

[/code]
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
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!