TheSwamp
Code Red => .NET => Topic started by: Bobby C. Jones on June 29, 2006, 08:57:38 AM
-
Does the 2007 version of the managed API wrap this function anywhere? I couldn't find anything last night and have rolled my own version, but considering that they wrapped acedDragGen() it seems at least somewhat likely that acedXformSS() is out there, somewhere...
-
I am tired and an EXTREMELY quick look resulted in this:
Autodesk.AutoCAD.EditorInput.DragCallback MethodsInvoke
Autodesk.AutoCAD.EditorInput.SamplerStatus
Invoke(
Autodesk.AutoCAD.Geometry.Point3d current,
Autodesk.AutoCAD.Geometry.Matrix3d& xform)
Parameters
current Input Autodesk.AutoCAD.Geometry.Point3d object.
xform Input Autodesk.AutoCAD.Geometry.Matrix3d& object.
Return Type
Autodesk.AutoCAD.EditorInput.SamplerStatus
No idea if this is what you are after Bobby, but I am off to la la land...night.
Cheers,
Glenn.
-
I am tired <snip> I am off to la la land...night.
Hey Glenn,
Thanks for taking a look at this. Have a good rest!
an EXTREMELY quick look resulted in this:
Autodesk.AutoCAD.EditorInput.DragCallback MethodsInvoke
<snip>
That's a related topic, and I was able to create a DragCallback delegate, but it's not quite what I was looking for.
I am re-visiting the 2006 code from here http://www.theswamp.org/index.php?topic=8198.0, which drags selected entities around the cursor and copies them to a new location, mimicking the COPY command (I never did get all the bugs worked out). Now in '07 they have wrapped acedDragGen() and made it all a moot point. However, I wasn't able to find where, or if, they wrapped acedXformSS(). I banged out a quick version late last night, but I don't want to pursue it any further if it's provided in the API.
private void TransformSelectionSet(SelectionSet ss, Matrix3d transMat)
{
if (ss.Count == 0)
{
return;
}
Database targetDatabase = ss[0].ObjectId.Database;
using (Transaction trans = targetDatabase.TransactionManager.StartTransaction())
{
BlockTableRecord currentSpace = (BlockTableRecord)trans.GetObject(targetDatabase.CurrentSpaceId, OpenMode.ForWrite);
foreach (SelectedObject selectedObj in ss)
{
Entity selectedEntity = (Entity)trans.GetObject(selectedObj.ObjectId, OpenMode.ForRead);
Entity transformedEntity = selectedEntity.GetTransformedCopy(transMat);
currentSpace.AppendEntity(transformedEntity);
trans.AddNewlyCreatedDBObject(transformedEntity, true);
}
trans.Commit();
}
}