Costinbos77 Posted September 10, 2020 Share Posted September 10, 2020 (edited) Hi , if : (setq MLeaderStyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE")) _$ (vlax-dump-object MLeaderStyles T) ; IAcadDictionary: Un objet incorporant de stockage et de récupération des objets ; Valeurs de propriétés: ; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff622d6b910> ; Count (RO) = 1 ; Document (RO) = #<VLA-OBJECT IAcadDocument 00000171d1d23398> ; Handle (RO) = "D7" ; HasExtensionDictionary (RO) = 0 ; Name = "ACAD_MLEADERSTYLE" ; ObjectID (RO) = 42 ; ObjectName (RO) = "AcDbDictionary" ; OwnerID (RO) = 43 ; Méthodes prises en charge: ; AddObject (2) ; AddXRecord (1) ; Delete () ; GetExtensionDictionary () ; GetName (1) ; GetObject (1) ; GetXData (3) ; Item (1) ; Remove (1) ; Rename (2) ; Replace (2) ; SetXData (2) T _$ (setq ml0 (vla-Item MLeaderStyles 0)) #<VLA-OBJECT IAcadMLeaderStyle 00000171cf866968> _$ (vlax-dump-object ml0 T) ; IAcadMLeaderStyle: Interface du style de ligne de repère multiple d'AutoCAD ; Valeurs de propriétés: ; AlignSpace = 0.18 ; Annotative = 0 ; Application (RO) = #<VLA-OBJECT IAcadApplication 00007ff622d6b910> ; ArrowSize = 0.18 ; ArrowSymbol = "" ; BitFlags = 0 ; Block = "" ; BlockColor = #<VLA-OBJECT IAcadAcCmColor 00000171910057d0> ; BlockConnectionType = 0 ; BlockRotation = 0.0 ; BlockScale = 1.0 ; BreakSize = 0.125 ; ContentType = 2 ; Description = "Standard" ; Document (RO) = #<VLA-OBJECT IAcadDocument 00000171d1d23398> ; DoglegLength = 0.36 ; DrawLeaderOrderType = 0 ; DrawMLeaderOrderType = 1 ; EnableBlockRotation = -1 ; EnableBlockScale = -1 ; EnableDogleg = -1 ; EnableFrameText = 0 ; EnableLanding = -1 ; FirstSegmentAngleConstraint = 0 ; Handle (RO) = "D8" ; HasExtensionDictionary (RO) = 0 ; LandingGap = 0.09 ; LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 0000017191005230> ; LeaderLinetype = 1 ; LeaderLineTypeId = "ByBlock" ; LeaderLineWeight = -2 ; MaxLeaderSegmentsPoints = 2 ; Name = "Standard" ; ObjectID (RO) = 44 ; ObjectName (RO) = "AcDbMLeaderStyle" ; OverwritePropChanged (RO) = 0 ; OwnerID (RO) = 42 ; ScaleFactor = 1.0 ; SecondSegmentAngleConstraint = 0 ; TextAlignmentType = 0 ; TextAngleType = 1 ; TextAttachmentDirection = 0 ; TextBottomAttachmentType = 0 ; TextColor = #<VLA-OBJECT IAcadAcCmColor 0000017191006130> ; TextHeight = 0.18 ; TextLeftAttachmentType = 1 ; TextRightAttachmentType = 1 ; TextString = "" ; TextStyle = "Standard" ; TextTopAttachmentType = 0 ; Méthodes prises en charge: ; Delete () ; GetExtensionDictionary () ; GetXData (3) ; SetXData (2) T why the next code is not working in AutoCAD Map 2021 french version and Windows 10 ? (setq NewMLeaderStyle (vla-AddObject MLeaderStyles "NewName" "AcDbMLeaderStyle")) ; erreur: Erreur Automation Entrée AcRxClassName ne se trouve pas dans le registre du système in En : ; Error: Automation Error AcRxClassName entry not found in the system registry "AcDbMLeaderStyle" is diffrent in AutoCAD Map 2021 ? was working in AutoCAD Map 2011 . Regards , Costin Edited September 10, 2020 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
pkenewell Posted September 10, 2020 Share Posted September 10, 2020 (edited) Try using this instead to get your Mleaderstyle collection: (setq mleaderstyles (vlax-ename->vla-object (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE"))) ) ) Otherwise I don't know why it would not work. Edited September 10, 2020 by pkenewell Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted September 10, 2020 Author Share Posted September 10, 2020 (edited) Hi pkenewell , your expresion it is for 'MLeaderStyles' collection and it is working , is not working to add a New MLeader Style . In your AutoCAD Mechanical 2016 , my codes are working fine ? (setq MLeaderStyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE")) ;#<VLA-OBJECT IAcadDictionary 000000003c72e548> (setq NewMLeaderStyle (vla-AddObject MLeaderStyles "NewName" "AcDbMLeaderStyle")) ;#<VLA-OBJECT IAcadMLeaderStyle 000000003c1e17e8> Regards , Costin Edited September 10, 2020 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
ronjonp Posted September 10, 2020 Share Posted September 10, 2020 Your code above works in Vanilla AutoCAD 2021. Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted September 10, 2020 Author Share Posted September 10, 2020 Thanks ronjonp , so , it is something diffrent with AutoCAD Map 2021 . Quote Link to comment Share on other sites More sharing options...
pkenewell Posted September 10, 2020 Share Posted September 10, 2020 (edited) 30 minutes ago, Costinbos77 said: Hi pkenewell , your expresion it is for 'MLeaderStyles' collection and it is working , is not working to add a New MLeader Style . In your AutoCAD Mechanical 2016 , my codes are working fine ? (setq MLeaderStyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE")) ;#<VLA-OBJECT IAcadDictionary 000000003c72e548> (setq NewMLeaderStyle (vla-AddObject MLeaderStyles "NewName" "AcDbMLeaderStyle")) ;#<VLA-OBJECT IAcadMLeaderStyle 000000003c1e17e8> Regards , Costin @Costinbos77 yeah I was reaching for straws. Thought in might be in how the collection object was obtained - I'm stumped otherwise - no way to test as I don't have Map, let alone the french version. I need to update my profile LOL - I am currently using Vanilla 2020! Edited September 10, 2020 by pkenewell Quote Link to comment Share on other sites More sharing options...
Costinbos77 Posted September 10, 2020 Author Share Posted September 10, 2020 (edited) Seems to be an old problem with missing registers ! Edited September 10, 2020 by Costinbos77 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.