Author Topic: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches  (Read 1393 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 527

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ()
  2.   (if (and
  3.         (setq
  4.           len (getreal "\Dogleg Length<Exit>:")
  5.         )
  6.         (setq ss (xdrx-ssget
  7.                    "\nSelect The MLeader <Exit>:"
  8.                    '((0 . "m*leader"))
  9.                  )
  10.         )
  11.       )
  12.     (progn
  13.       (xdrx-begin)
  14.       (setq nums (sslength ss))
  15.       (xdrx-setpropertyvalue ss "DoglegLength" len)
  16.       (xdrx-prompt
  17.         "\nSuccessfully Processing "
  18.         nums
  19.         " Mleader Leaderline."
  20.       )
  21.       (xdrx-end)
  22.     )
  23.   )
  24.   (princ)
  25. )
  26.  
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #1 on: December 02, 2023, 09:57:00 AM »
You can also do this for color of layer
and make text style
Thanks

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #2 on: December 04, 2023, 05:33:06 AM »
Can you also change this distance (see picture)
Thanks


I'm sure it's done, I managed to adapt the Lisp myself
« Last Edit: December 04, 2023, 07:46:10 AM by Hugo »

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #3 on: December 04, 2023, 09:12:28 AM »
Can you also change this distance (see picture)
Thanks


I'm sure it's done, I managed to adapt the Lisp myself

Unfortunately, I didn't find the method provided by ARX that can modify what you need.
You can compromise and underline as shown in the figure, and then modify the DOGLEG length to flexibly put your text where it needs to be.

=========

You can find that the place you want to modify is in the MTEXT background box. I haven't found that this can be modified.
The places where you can modify MLEADER are all in the red box in the picture. If you find it here, then I will have a solution.

The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #4 on: December 04, 2023, 09:17:57 AM »
Can you also change this distance (see picture)
Thanks


I'm sure it's done, I managed to adapt the Lisp myself

Found a way

Modify the landing gap in the picture to a negative value to make the text move forward.

The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #5 on: December 04, 2023, 09:18:44 AM »
I changed that and it now works as I want

(xdrx-setpropertyvalue ss "DoglegLength" len)

  (xdrx-setpropertyvalue ss "LandingGap" len)

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #6 on: December 04, 2023, 09:25:59 AM »
Can you also change this distance (see picture)
Thanks


I'm sure it's done, I managed to adapt the Lisp myself

Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ()
  2.   (if (and
  3.         (setq gap (getreal "\nInput Landing Gap<Exit>:"))
  4.         (setq
  5.           ss (xdrx-ssget "\nSelect Mleader<Exit>:" '((0 . "m*leader")))
  6.         )
  7.       )
  8.     (progn
  9.       (xdrx-begin)
  10.       (xdrx-setpropertyvalue ss "landinggap" gap)
  11.       (xdrx-end)
  12.     )
  13.   )
  14.   (princ)
  15. )
  16.  
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #7 on: December 04, 2023, 09:30:20 AM »
I changed that and it now works as I want

(xdrx-setpropertyvalue ss "DoglegLength" len)

  (xdrx-setpropertyvalue ss "LandingGap" len)

Awesome,

With the above set of codes, you can batch modify anything in MLEADER with appropriate modifications.

Only the entity name parameter is given, and the content that can be modified by xdrx-setproperyvalue is printed out.

Command: (xdrx-setpropertyvalue (entlast))

Class AcDbMLeader:
  ├─AddFirstVertex (Int Point)
  ├─AddLastVertex (Int Point)
  ├─AddLeader (Int)
  ├─AddLeaderLine (Int Int or Point Int)
  ├─MoveLeader (Vector int [T])
  ├─RecomputeBreakPoints (None)
  ├─RemoveFirstVertex (Int)
  ├─RemoveLastVertex (Int)
  ├─RemoveLeader (Int)
  ├─RemoveLeaderLine (Int)
  ├─RemoveLeaderLineRefAssoc (Int)
  ├─ArrowSize (Double)
  ├─ArrowSymbolId (Ename or STR or NIL or (Int and Ename or STR))
  ├─BlockAttributeValue (Ename STR)
  ├─BlockColor (Int or (R G B))
  ├─BlockConnectionType (Int)
  ├─BlockContentId (Ename)
  ├─setBlockPosition (Point)
  ├─BlockRotation (Double)
  ├─BlockScale (Double or (Double Double Double)
  ├─ContentType (Int)
  ├─DoglegDirection (Int Vector)
  ├─DoglegReverse (None)
  ├─DoglegLength (Double)
  ├─EnableAnnotationScale (T or NIL)
  ├─EnableDogleg (T or NIL)
  ├─EnableFrameText (T or NIL)
  ├─TextFrameDisplay (T or NIL)
  ├─FirstVertex
  ├─EnableLanding (T or NIL)
  ├─LastVertex
  ├─LandingGap (Double)
  ├─LeaderLineAngle (Real 0-2PI)
  ├─LeaderLineLength (Real or Int)
  ├─LeaderLineColor (Int or (R G B))
  ├─LeaderLineLength (Int or Real)
  ├─LeaderLineType (Int)
  ├─LeaderLineTypeId (Ename)
  ├─LeaderLineWeight (Int)
  ├─Quadrant (Int)
  ├─NegateDoglegDirection (None)
  ├─NegateLeaderlineDirection (Int)
  ├─PerpDoglegDirection (Int)
  ├─MLeaderStyle
  ├─Mirror (0 or 1 or 2)
  ├─MText (Str or Ename)
  ├─Override (Int <T or nil>)
  ├─Plane (GePlane)
  ├─Scale (Double)
  ├─TextAlignmentType (Int)
  ├─TextAngleType (Int)
  ├─TextAttachmentType (Int)
  ├─TextColor (Int or (R G B))
  ├─TextHeight (Double)
  ├─TextStyleId (Ename)
  ├─UpdateLeaderLinePosition (None)
  ├─Update (None or T)
  ├─HorizAlign (Point)
  ├─VAlign (Point or (Point and T))
Class AcDbMText:
  ├─Attachment(1-9)
  ├─TextBackgroundFill(T or Nil)
  ├─TextLineSpacingFactor(Real)
  ├─TextLineSpacingStyle(1 or 2)
  ├─TextLocation(Point)
  ├─TextRotation(Real)
  ├─TextHeight(Real or Int)
  ├─TextString(Real or Int)
  ├─TextStyle(STR or Ename)
  ├─TextWidth
Class AcDbEntity:
  ├─Color(Int)
  ├─Elevation(Int or Real)
  ├─Layer(STR)
  ├─Linetype(STR)
  ├─LinetypeScale(Real or Int)
  ├─LineWeight(INT)
  ├─PlotStyleName(STR)
  ├─OrthoProject(Plane T)
  ├─Project(Plane Normal T)
  ├─TransformBy
  ├─Transparency(0-100)
  ├─Visibility(T or Nil)
  ├─Z->0(None Or T)
Class AcDbObject:
  ├─CopyFrom (Ename)
  ├─RemovePersistentReactor (ENAME)
  ├─CreateExtensionDictionary (None)
  ├─releaseExtensionDictionary (None)
  ├─SetXdata (STR val1...valn)
  ├─xDataTransformBy (matrix)
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

Hugo

  • Bull Frog
  • Posts: 435
Re: [XDrX-PlugIn(25)] Modify Mleader LeaderLine Dogleg length in batches
« Reply #8 on: December 04, 2023, 09:36:19 AM »
great thanks for the info and the Lisp