.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

rotateddimension bug in 2006

4 REPLIES 4
Reply
Message 1 of 5
netcai
320 Views, 4 Replies

rotateddimension bug in 2006

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.
4 REPLIES 4
Message 2 of 5
Anonymous
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.
Message 3 of 5
netcai
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;
}
}
Message 4 of 5
Anonymous
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;
}
}
Message 5 of 5
netcai
in reply to: netcai

thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost