Jump to content

ILoveMadoka

Recommended Posts

I have a legacy drawing where someone has changed some of the leader arrows to dots 

but they are using the wrong symbol and wrong size.

I can select the leader in question and change the properties of these two items 

in the Properties dialog.

 

image.png.eba13c91c3bca7bf9e89cb360f8c6243.png

 

Can this be accomplished via lisp?

(Command "xxxx" "Dot") 

; Or 

(Setvar "xxxx" "Dot")

(Command "dimasz" .09375)

 

Properties says it is a Leader

image.png.87b6612b08facd49b5f73e5fbbf5a5fe.png

 

I really would prefer to not make a whole new Style for these items

but there are so many that need to be changed scattered across the many sheets, that it would be a huge time saver with a small routine..

 

I don't see it here..

(setq XD (entget (car (entsel))))

 

* List in AutoLISP format *((-1 . <Entity name: 29f052416f0>) 
(0 . LEADER) (330 . <Entity name: 29ed564db80>) (5 . C0C37) (100 . AcDbEntity) (67 . 1) 
(410 . SH65H) (8 . Text) (100 . AcDbLeader) (3 . STANDARD) (71 . 1) (72 . 0) (73 . 3) 
(74 . 1) (75 . 0) (40 . 0.0) (41 . 0.0) (76 . 3) (10 4.33416 8.92996 0.0) 
(10 4.61755 10.2826 0.0) (10 4.73268 10.2826 0.0) (340 . <Entity name: 0>) 
(211 1.0 0.0 0.0) (210 0.0 0.0 1.0) (212 0.0 0.0 0.0) (213 0.0 0.0 0.0))
Variable name is ENT

 

or here..

(entget (car (entsel)) '("ACAD"))

 

Select object: ((-1 . <Entity name: 29f052416f0>) (0 . "LEADER") (330 . <Entity name: 29ed564db80>) 
(5 . "C0C37") (100 . "AcDbEntity") (67 . 1) (410 . "SH65H") (8 . "Text") (100 . "AcDbLeader") (3 . "STANDARD") 
(71 . 1) (72 . 0) (73 . 3) (74 . 1) (75 . 0) (40 . 0.0) (41 . 0.0) (76 . 3) (10 4.33416 8.92996 0.0) 
(10 4.61755 10.2826 0.0) (10 4.73268 10.2826 0.0) (340 . <Entity name: 0>) (211 1.0 0.0 0.0) (210 0.0 0.0 1.0) 
(212 0.0 0.0 0.0) (213 0.0 0.0 0.0) (-3 ("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 41) (1040 . 0.09375) 
(1070 . 40) (1040 . 1.0) (1070 . 49) (1040 . 0.1875) (1070 . 341) (1005 . "5AE25") (1070 . 345) (1005 . "12") 
(1070 . 346) (1005 . "12") (1070 . 347) (1005 . "12") (1002 . "}"))))

 

Arrow size?

 

(1040 . 0.1875)

Do you use (entmod) to change??

 

I've looked here for some insight (It is not obvious to me..)

 

Autocad 2018 DXF Group Codes
 

This is beyond me

I'm lost... (I am trying though)

 

Help please?

 

Edited by ILoveMadoka
Link to comment
Share on other sites

This is what I came up with for anyone else who may need it...

(It works for my situation)

 

(Defun c:AH1 ()
(Prompt "\nSelect Leader Objects to Change:")
(Setq SS (ssget))
(command "DIMOVERRIDE" "DIMLDRBLK" "Dot" "DIMASZ" "0.09375" "" ss "")
(Princ))

 

Link to comment
Share on other sites

Alternatively you could use ActiveX .. it's a bit easier than sifting through DXF codes:

; IAcadLeader: AutoCAD Leader Interface
; Property values:
;   Annotation = #<VLA-OBJECT IAcadMText 000001bc3526b298>
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff730986558>
;   ArrowheadBlock = ""
;   ArrowheadSize = 0.18
;   ArrowheadType = 0
;   Coordinate = ...Indexed contents not shown...
;   Coordinates = (799357.0 826469.0 0.0 799347.0 826482.0 0.0 ... )
;   DimensionLineColor = 256
;   DimensionLineWeight = -1
;   Document (RO) = #<VLA-OBJECT IAcadDocument 000001bc062bc078>
;   EntityTransparency = "ByLayer"
;   Handle (RO) = "643FD"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 000001bc3f19c988>
;   Layer = "leader"
;   Linetype = "ByLayer"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Material = "ByLayer"
;   Normal (RO) = (0.0 0.0 1.0)
;   ObjectID (RO) = 2241
;   ObjectName (RO) = "AcDbLeader"
;   OwnerID (RO) = 2240
;   PlotStyleName = "ByLayer"
;   ScaleFactor = 20.0
;   StyleName = "Standard"
;   TextGap = 0.09
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 000001bc3f19e000>
;   Type = 2
;   VerticalTextPosition = 0
;   Visible = -1
(setq o (vlax-ename->vla-object (car (entsel))))
(vla-put-arrowheadblock o "Dot")
(vla-put-arrowheadsize o 0.09375)

 

Link to comment
Share on other sites

4 minutes ago, ILoveMadoka said:

These all work perfectly if it a LEADER that is selected.

 

None of them work if an MLEADER is selected. 😕

 

 

Pick your mleader and see what properties are available:

(defun c:vlaxprop (/ e)
  (if (setq e (car (entsel "\nSelect object to show data: ")))
    (vlax-dump-object (vlax-ename->vla-object e) t)
  )
  (textscr)
)

 

Link to comment
Share on other sites


Select object to show data:
; IAcadMLeader: AutoCAD Multi-Leader Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff761b1b0b8>
;   ArrowheadBlock = ""
;   ArrowheadSize = 0.18
;   ArrowheadType = 0
;   BlockConnectionType = 0
;   BlockScale = 1.0
;   ContentBlockName = ""
;   ContentBlockType = 6
;   ContentType = 2
;   Document (RO) = #<VLA-OBJECT IAcadDocument 0000029ecd660d18>
;   DogLegged = -1
;   DoglegLength = 0.125
;   EntityTransparency = "ByLayer"
;   Handle (RO) = "C620E"
;   HasExtensionDictionary (RO) = 0
;   Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000029f217d5918>
;   LandingGap = 0.09
;   Layer = "Text"
;   LeaderCount (RO) = 1
;   LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 0000029f217d62d0>
;   LeaderLinetype = "BYBLOCK"
;   LeaderLineWeight = -2
;   LeaderType = 1
;   Linetype = "BYLAYER"
;   LinetypeScale = 1.0
;   Lineweight = -1
;   Material = "ByLayer"
;   ObjectID (RO) = 73
;   ObjectName (RO) = "AcDbMLeader"
;   OwnerID (RO) = 74
;   PlotStyleName = "ByLayer"
;   ScaleFactor = 1.0
;   StyleName = "Standard"
;   TextAttachmentDirection = 0
;   TextBackgroundFill = 0
;   TextBottomAttachmentType = 0
;   TextDirection = 5
;   TextFrameDisplay = 0
;   TextHeight = 0.125
;   TextJustify = 3
;   TextLeftAttachmentType = 1
;   TextLineSpacingDistance = 0.208333
;   TextLineSpacingFactor = 1.0
;   TextLineSpacingStyle = 1
;   TextRightAttachmentType = 5
;   TextRotation = 0.0
;   TextString = "\\A1;7/16\" X 45%%D \\PSNIPE"
;   TextStyleName = "ROMANS"
;   TextTopAttachmentType = 0
;   TextWidth = 0.0
;   TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000029f217d5bb0>
;   Visible = -1
; Methods supported:
;   AddLeader ()
;   AddLeaderLine (2)
;   AddLeaderLineEx (1)
;   ArrayPolar (3)
;   ArrayRectangular (6)
;   Copy ()
;   Delete ()
;   GetBlockAttributeValue (1)
;   GetBoundingBox (2)
;   GetDoglegDirection (1)
;   GetExtensionDictionary ()
;   GetLeaderIndex (1)
;   GetLeaderLineIndexes (1)
;   GetLeaderLineVertices (1)
;   GetVertexCount (1)
;   GetXData (3)
;   Highlight (1)
;   IntersectWith (2)
;   Mirror (2)
;   Mirror3D (3)
;   Move (2)
;   RemoveLeader (1)
;   RemoveLeaderLine (1)
;   Rotate (2)
;   Rotate3D (3)
;   ScaleEntity (2)
;   SetBlockAttributeValue (2)
;   SetDoglegDirection (2)
;   SetLeaderLineVertices (2)
;   SetXData (2)
;   TransformBy (1)
;   Update ()
T

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...