.NET

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

rotateddimension bug in 2006

117 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 (117 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 (117 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 (117 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 (117 Views)

Re: rotateddimension bug in 2006

05-25-2005 12:26 AM in reply to: netcai
thanks.
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.