0 Members and 1 Guest are viewing this topic.
Have a look at GetObjectSnapPoints() in the managed arx reference help, all drawn autocad entities have this property and using this api you have direct access to them.hth.
Sorry Jeff, I don't but James may have coded something up he can share.In the mean time I would suggest looking into the ARX ref.-> AcDb -> AcDbEntity-> getOsnapPoints() method which explains how and what the parameters are used for (the managed method simply wraps this so it should be very similar). While the managed help does list all/most methods available they have little help in the way of using them and I guess they expect you to be able to understand the C/C++ help already available.cheers.
Sorry Jeff, I don't but James may have coded something up he can share.cheers.
Matrix3d mat = new Matrix3d();mat = Matrix3d.Identity();ent.GetObjectSnapPoints(ObjectSnapModes.ModeMid, 0, pickPt, pickPt, mat, snapPts, geomIds);
ps:Welcome to theSwamp Jeff !Great to see another adventurer posting here.
(defun Initialize ()(setq NewLayer "ANNO-NOTE")(if (null (tblsearch "LAYER" NewLayer)) (command "._layer" "new" NewLayer "s" NewLayer "C" "2" NewLayer ""));End if(command "._layer" "s" "ANNO-NOTE" "")(command "COLOR" "BYLAYER") (setq OldSnapMode (getvar "OSMODE"))(SETVAR "OSMODE" 0) (setq DwgScale (/ 1.0 (getvar "CANNOSCALEVALUE"))) (setq Entity (nentsel))(setq EndPoint (osnap (cadr Entity) "End"))(setq MidPoint (osnap (cadr Entity) "mid")) (setq LineAngle (rtd (angle EndPoint MidPoint)));Adjust Angle for proper text orientation(if (and (> LineAngle 90.1) (< LineAngle 270.1) ) (setq LineAngle (- LineAngle 180)) );end if );END DEFUN (defun c:BMX (/ NewLayer OldSnapMode Entity EndPoint MidPoint LineAngle DwgScale TextPoint)(Initialize)(setq TextPoint (Polar MidPoint (dtr (+ LineAngle 90)) (* 0.03125 DwgScale)))(initdia)(command "._MText" TextPoint "J" "BC" "R" LineAngle "W" "0")(SETVAR "OSMODE" OldSnapMode));End defun(defun c:UBMX (/ NewLayer OldSnapMode Entity EndPoint MidPoint LineAngle DwgScale TextPoint)(Initialize)(setq TextPoint (Polar MidPoint (dtr (+ LineAngle 270)) (* 0.03125 DwgScale)))(initdia)(command "._MText" TextPoint "J" "TC" "R" LineAngle "W" "0")(SETVAR "OSMODE" OldSnapMode));End defun
[CommandMethod("BeaMtext")] public void AddBeamText() { Editor ed = Application.DocumentManager.MdiActiveDocument.Editor; Database db = HostApplicationServices.WorkingDatabase; Transaction tr = db.TransactionManager.StartTransaction(); PromptEntityResult selectionRes = ed.GetEntity("Select Entity "); if (selectionRes.Status == PromptStatus.OK) { try { ObjectId objId = selectionRes.ObjectId; Entity ent = (Entity)tr.GetObject(objId, OpenMode.ForRead); Point3d pickPt = selectionRes.PickedPoint; Matrix3d mat = new Matrix3d(); mat = Matrix3d.Identity; Point3dCollection snapPts = new Point3dCollection(); IntegerCollection geomIds = new IntegerCollection(); geomIds.Add(0); ent.GetObjectSnapPoints(ObjectSnapModes.ModeMid, 1, pickPt, pickPt, mat, snapPts, geomIds); ed.WriteMessage("\nYour selected point is:" + pickPt.ToString()); ent.Dispose(); } catch (Autodesk.AutoCAD.Runtime.Exception ex) { ed.WriteMessage(ex.Message); tr.Abort(); } }//end if }//end function