Author Topic: acedXformSS()  (Read 3344 times)

0 Members and 1 Guest are viewing this topic.

Bobby C. Jones

  • Swamp Rat
  • Posts: 516
  • Cry havoc and let loose the dogs of war.
acedXformSS()
« 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...
Bobby C. Jones

Glenn R

  • Guest
Re: acedXformSS()
« Reply #1 on: June 29, 2006, 09:19:45 AM »
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.

Bobby C. Jones

  • Swamp Rat
  • Posts: 516
  • Cry havoc and let loose the dogs of war.
Re: acedXformSS()
« Reply #2 on: June 29, 2006, 01:42:10 PM »
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.

Code: [Select]
    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();
      }
    }
Bobby C. Jones