Hi,
I need dimensions objects (like we have in Autocad) to be added to my industry model and that custom feature would be manipulated like the Dimension in Autocad. Could you give me to information on how to code such feature or even better c++ sample code doing similar things.
Thanks,
SChikh
Solved! Go to Solution.
Hi,
I need dimensions objects (like we have in Autocad) to be added to my industry model and that custom feature would be manipulated like the Dimension in Autocad. Could you give me to information on how to code such feature or even better c++ sample code doing similar things.
Thanks,
SChikh
Solved! Go to Solution.
Solved by fieldguy. Go to Solution.
maybe you can get started with a dimension jig?
here is a link to an article from @Anonymous.yuan
https://drive-cad-with-code.blogspot.com/2020/04/jig-with-dimension.html
maybe you can get started with a dimension jig?
here is a link to an article from @Anonymous.yuan
https://drive-cad-with-code.blogspot.com/2020/04/jig-with-dimension.html
Hi Fieldguy,
Your reply interesting, showing the Dimension Jig when editing my point feature is something I will need, do you have an Idea how to permanetly show the Dimension ? This is needed to show distances in an Industry Model map (like in a CAD drawing).
Thanks,
SChikh
Hi Fieldguy,
Your reply interesting, showing the Dimension Jig when editing my point feature is something I will need, do you have an Idea how to permanetly show the Dimension ? This is needed to show distances in an Industry Model map (like in a CAD drawing).
Thanks,
SChikh
here's a link to another dimension jig - this dimension gets "appended" to the modelspace blocktablerecord.
https://forums.autodesk.com/t5/net/jigging-a-dimension-to-follow-mouse/m-p/11954864
if i get time later today i will modify norman's code to add the dimension tot the database.
here's a link to another dimension jig - this dimension gets "appended" to the modelspace blocktablerecord.
https://forums.autodesk.com/t5/net/jigging-a-dimension-to-follow-mouse/m-p/11954864
if i get time later today i will modify norman's code to add the dimension tot the database.
I was hoping you would solve this yourself. Below is my interpretation of Norman's Move() method. If the jig status is OK, add the dimension to the current space.
public void Move2()
{
if (!SelectEntity(out ObjectId entId, out Point3d basePt)) return;
_entityId = entId;
_basePoint = basePt;
_prevPoint = basePt;
_movingPoint = basePt;
var offset = GetDimLineOffset(_entityId);
var dimTextPt = GetMidOffsetPoint(_basePoint, _movingPoint, offset);
try
{
_dim = new AlignedDimension(
_basePoint,
_movingPoint,
dimTextPt,
"0000",
_dwg.Database.DimStyleTableId);
using (var tran = _dwg.TransactionManager.StartTransaction())
{
_entity = (Entity)tran.GetObject(_entityId, OpenMode.ForWrite);
var res = _ed.Drag(this);
if (res.Status == PromptStatus.OK)
{
var db = _dwg.Database;
var cspacebtr = (BlockTableRecord)tran.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
cspacebtr.AppendEntity(_dim);
tran.AddNewlyCreatedDBObject(_dim, true);
}
else
{
_dim.Dispose();
}
tran.Commit();
}
}
finally { }
_ed.WriteMessage("\nDim added");
}
Are you looking for something specific to Map3D?
I was hoping you would solve this yourself. Below is my interpretation of Norman's Move() method. If the jig status is OK, add the dimension to the current space.
public void Move2()
{
if (!SelectEntity(out ObjectId entId, out Point3d basePt)) return;
_entityId = entId;
_basePoint = basePt;
_prevPoint = basePt;
_movingPoint = basePt;
var offset = GetDimLineOffset(_entityId);
var dimTextPt = GetMidOffsetPoint(_basePoint, _movingPoint, offset);
try
{
_dim = new AlignedDimension(
_basePoint,
_movingPoint,
dimTextPt,
"0000",
_dwg.Database.DimStyleTableId);
using (var tran = _dwg.TransactionManager.StartTransaction())
{
_entity = (Entity)tran.GetObject(_entityId, OpenMode.ForWrite);
var res = _ed.Drag(this);
if (res.Status == PromptStatus.OK)
{
var db = _dwg.Database;
var cspacebtr = (BlockTableRecord)tran.GetObject(db.CurrentSpaceId, OpenMode.ForWrite);
cspacebtr.AppendEntity(_dim);
tran.AddNewlyCreatedDBObject(_dim, true);
}
else
{
_dim.Dispose();
}
tran.Commit();
}
}
finally { }
_ed.WriteMessage("\nDim added");
}
Are you looking for something specific to Map3D?
Thanks fieldguy, exactly what I was lookin for👍
Thanks fieldguy, exactly what I was lookin for👍
Can't find what you're looking for? Ask the community or share your knowledge.