.NET

Reply
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 1 of 5 (113 Views)

rotateddimension bug in 2006

113 Views, 4 Replies
05-24-2005 03:50 AM
I use c# 2005 beta2 and to develop autocad 2006, I want to get a rotateddimension, but when I create a rotateddimension in 2006 , I got a aligneddimension. and the rotation property of roteddimension can't be set and read, it will cause a fatal error.
*Albert Szilvasy
Message 2 of 5 (113 Views)

Re: rotateddimension bug in 2006

05-24-2005 10:47 AM in reply to: netcai
Can you please post some code that shows the problem? Thanks,
Albert
wrote in message news:4854215@discussion.autodesk.com...
I use c# 2005 beta2 and to develop autocad 2006, I want to get a
rotateddimension, but when I create a rotateddimension in 2006 , I got a
aligneddimension. and the rotation property of roteddimension can't be set
and read, it will cause a fatal error.
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 3 of 5 (113 Views)

Re: rotateddimension bug in 2006

05-24-2005 05:43 PM in reply to: netcai
thanks albert ,
my code is :
RotatedDimension rd = new RotatedDimension();
rd.XLine1Point = startPoint;
rd.XLine2Point = endPoint;
rd.DimLinePoint = locPoint;
//rd.Rotation = rotation; // this line will cause fatal error
ObjectId id = Tools.AddEntity(rd);
addentity is a function of my tools class
public static ObjectId AddEntity(Entity ent)
{
try
{
using (Transaction trans = Tm.StartTransaction())
{
BlockTable bt = (BlockTable)Tm.GetObject(Db.BlockTableId, OpenMode.ForWrite, false);
BlockTableRecord btr = BlockTableRecord)Tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
btr.AppendEntity(ent);
Tm.AddNewlyCreatedDBObject(ent, true);
trans.Commit();

return ent.ObjectId;
}

}
catch (System.Exception e)
{
throw e;
}
}
*Albert Szilvasy
Message 4 of 5 (113 Views)

Re: rotateddimension bug in 2006

05-24-2005 10:25 PM in reply to: netcai
I see. The default constructor is broken. Use the other constructor like
this:
RotatedDimension rd = new RotatedDimension(1.2,new Point3d(0,0,0),new
Point3d(1,0,0),new Point3d(1,1,1),"some text",ObjectId.Null);

Sorry about the inconvenience. I see to it that we fix this for the next
release.

albert

wrote in message news:4855391@discussion.autodesk.com...
thanks albert ,
my code is :
RotatedDimension rd = new RotatedDimension();
rd.XLine1Point = startPoint;
rd.XLine2Point = endPoint;
rd.DimLinePoint = locPoint;
//rd.Rotation = rotation; // this line will cause fatal
error
ObjectId id = Tools.AddEntity(rd);
addentity is a function of my tools class
public static ObjectId AddEntity(Entity ent)
{
try
{
using (Transaction trans = Tm.StartTransaction())
{
BlockTable bt =
(BlockTable)Tm.GetObject(Db.BlockTableId, OpenMode.ForWrite, false);
BlockTableRecord btr =
BlockTableRecord)Tm.GetObject(bt[BlockTableRecord.ModelSpace],
OpenMode.ForWrite, false);
btr.AppendEntity(ent);
Tm.AddNewlyCreatedDBObject(ent, true);
trans.Commit();

return ent.ObjectId;
}

}
catch (System.Exception e)
{
throw e;
}
}
Valued Contributor
netcai
Posts: 66
Registered: ‎07-22-2004
Message 5 of 5 (113 Views)

Re: rotateddimension bug in 2006

05-25-2005 12:26 AM in reply to: netcai
thanks.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

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 to get help installing your software.

Ask the Community