Jump to content

Search the Community

Showing results for tags 'multileader'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. Can anyone help me edit the LISP for TCOUNT to include the text for Multileaders? I've added (0 . "MULTILEADER") to the LISP but it will not edit the text. I haven't done much with LISP's, so any help would be appreciated. Thanks.
  2. I'm searching the forums for how to create multileader, I found the following lisp to create it but they don't have Arrowhead installed, I tried with parameter: '("ArrowSymbol" . "LA-ARRW") , but it don't work. Can it be fixed? (defun CreateMLeaderStyle (CMS_NewName CMS_Config / CMS_TextStyle CMS_MLeaderStyles CMS_NewMLeaderStyle CMS_Property CMS_ColorObject) (if (or (and (setq CMS_TextStyle (cdr (assoc "TextStyle" CMS_Config))) (tblsearch "STYLE" CMS_TextStyle) ) (not (cdr (assoc "TextStyle" CMS_Config))) ) (progn (setq CMS_MLeaderStyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE")) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list CMS_MLeaderStyles CMS_NewName))) (progn (setq CMS_NewMLeaderStyle (vla-AddObject CMS_MLeaderStyles CMS_NewName "AcDbMLeaderStyle")) (if (not (cdr (assoc "TextStyle" CMS_Config))) (vla-put-TextStyle CMS_NewMLeaderStyle (getvar "TEXTSTYLE")) ) (foreach CMS_Item CMS_Config (if (and (vl-consp CMS_Item) (= (type (setq CMS_Property (car CMS_Item))) 'STR) (not (listp (cdr CMS_Item))) (vlax-property-available-p CMS_NewMLeaderStyle CMS_Property) ) (cond ( (wcmatch (strcase CMS_Property) "*COLOR*") (setq CMS_ColorObject (vlax-get-property CMS_NewMLeaderStyle CMS_Property)) (vla-put-ColorIndex CMS_ColorObject (cdr CMS_Item)) (vl-catch-all-apply 'vlax-put-property (list CMS_NewMLeaderStyle CMS_Property CMS_ColorObject)) ) ( T (vl-catch-all-apply 'vlax-put-property (list CMS_NewMLeaderStyle CMS_Property (cdr CMS_Item))) ) ) ) ) (princ (strcat "\n ** Created " CMS_NewName " MLeader style")) ) (princ "\n ** Error: MLeader style already exists") ) ) (princ "\n ** Error: textstyle does not exist") ) (princ) ) ;MLeaderLandingDistance (defun MLeaderLandingDistance ( sty flg / dic ) (and (setq dic (dictsearch (namedobjdict) "acad_mleaderstyle")) (setq dic (dictsearch (cdr (assoc -1 dic)) sty)) (entmod (subst (cons 43 ((if flg + -) (abs (cdr (assoc 43 dic))))) (assoc 43 dic) dic)) ) ) (defun c:MMN () (setq txt (tblsearch "style" "L-ARIAL") ) (if (null txt) (progn (command "_-style" "L-ARIAL" "Arial.ttf" "0.0" "1.0" "0" "" "") ) ) (CreateMLeaderStyle "L-TAG-TEXT" (list '("ArrowSize" . 2) '("ArrowSymbol" . "Dot") '("DoglegLength" . 3) '("LandingGap" . 1) '("LeaderLineColor" . 256) (cons "ScaleFactor" 1) '("TextColor" . 256) '("TextHeight" . 2) '("TextLeftAttachmentType" . 1) '("TextRightAttachmentType" . 1) '("TextStyle" . "L-ARIAL") ) ) (princ) (command "cmleaderstyle" "L-TAG-TEXT") ;;;;;;==================================== (MLeaderLandingDistance (getvar 'cmleaderstyle) nil) )
  3. Hey guys! Do y'all know of a LISP that will label a hatch based on its name? Similar to what AlanJT did here with block name->mleader. Bonus points if you can get it to work with AlanJT's code, so I only need one command to label my blocks and hatches. And if this isn't possible, then is there a LISP for populating an mleader with a palette display description? Any help would be great! Thanks.
  4. I found this simple lisp code related to multileaders that's working for me, but instead of the text reading 'Aluminum', I'd like it to extract the block's attribute definition. For example, I have a piece of equipment that I've given several attribute definitions to represent the equipment's tag identification, manufacturer, model number, price and so on. How can I get the multileader to read the block's tag identification attribute automatically without manually entering the text information? I'd like to be able to quickly call out different pieces of equipment or furniture with a multileader that identifies their unique tags. new lisp.lsp
  5. Had to rotate a floorplan 180 along with all multileaders and text. I can easily select multileaders and change angle to 0 in Properties but text ends up on top of leader or in wrong position relative to leader. It would be great to have a command able to select a group of multileaders and step through them rotating them a desired angle about the end of the leader. Any takers? Thanks!
  6. I have a survey xrefed into a site plan. In the survey there is a multileader that needs to appear at two different scales, so I made it annotative. The same multileader sits on top of a hatch (which is in the site plan), so I gave it a background mask. At 1"=20', the larger scale, I can adjust the mask so that everything looks fine. When I switch to 1"=10', the other scale, the mask is too wide, and there's a big blank space. When I adjust the mask at 10 scale, the mask becomes too narrow for the 20 scale text, which wraps onto a second line. Apparently, I can make one version look nice, or the other, but not both. Has anyone else seen this? Is there some magic fix?
  7. Hi folks, I've posted here on the Bugs and quirks group. But I feel it's a job for lisp. Thing is one MLEADER in this example is not associating using the DRE command and the other is. I've dwgs where every other MLEADER is like this for some reason. See drawing attached. I've used the code below from the help pages and it comes back with both MLEADERS having an associated Extension Dictionary. All the usual dump VLA and DXF dumps come back with no dissimilarities either. (vl-load-com) (defun c:DumpExtensionDictionary() ;; This example will iterate through each object in the current drawing and ;; determine whether that object has an associated Extension Dictionary (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) (setq modelSpace (vla-get-ModelSpace doc)) ;; Make sure this drawing contains objects before continuing (if (= (vla-get-Count modelSpace) 0) (alert "There are no objects in the current drawing.") (progn (setq ExtensionDictionaryResults "") (vlax-for DrawingObject modelSpace ;; Determine whether object contains Extension Dictionary (cond ((= (vla-get-HasExtensionDictionary DrawingObject) :vlax-true) (setq ExtensionDictionaryResults (strcat ExtensionDictionaryResults (vla-get-ObjectName DrawingObject) " has an associated Extension Dictionary.\n"))) ((= (vla-get-HasExtensionDictionary DrawingObject) :vlax-false) (setq ExtensionDictionaryResults (strcat ExtensionDictionaryResults (vla-get-ObjectName DrawingObject) " does not have an associated Extension Dictionary.\n"))) ) ) (alert ExtensionDictionaryResults) ) ) ) MLEADER DIM ASSOC PROBLEM.dwg
  8. Hello, Could you help me with the following question? I would like to filter all the texts and multileaders at Z=0. I could solve it for texts by using the following code, but it does not work for multileaders when I simply change TEXT to MULTILEADER. How could I do it? (sslength (ssget "X" '((0 . "*TEXT") (-4 . "*,*,=") (10 0.0 0.0 0.0)))) Thanks a lot, Cs.
  9. I've only been learning LISPing for a few weeks so C&C's are most welcome. LINK TO VIDEO: One of my most used LISPs is the LeaderToMleader.LSP. Found here. It was last updated many moons ago, so I decided to try learn and modify it to suit. Many thanks to the original author Lyle Hardin. I just need some guidance on how to get UCS working with it. EDIT. Using the TRANS fn. It works okay. Took a bit of tweaking but I got it. Please test. Here's a list of things I've changed at the top of the code: Main ones are: Multiple Selection - User can now select the LEADER and MTEXT together and no longer individually resulting in a much faster conversion. Strip text - Of formatting option - LM:UnFormat fn written by LeeMac. Annotation support - Program simply matches the (entget) object to that of the (entlast) object. With the help of AT:isAnnotative written by Alan J. Thompson. Case conversion - Built in fns using (load "TcaseSup.lsp") - OPTIONS: Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase Verts - Leader_To_Multileader now supports 2 or 3 points. (Old method was only 2). It uses the 1st, 2nd (if applicable) and last verts of the LEADER. The 4th vert or more, will get removed. Text Rotation - MTEXT rotation is now preserved. Undo levels - As opposed to one command at a time. PS. How easy would it be to calculate the distance between the start point of the LEADER point and pos of the MTEXT and then for each of the closest pairs make them an MULTILEADER. That would be cool. ;;; CADALYST 08/08 www.cadalyst.com/code ; Tip 2305: Leader_To_Multileader.lsp LEADER to Multileader (c) 2008 Lyle Hardin ; Pick an old style LEADER and text to create a new MLEADER entity and erase the old LEADER and text. ; March/2008 ;;; EDITED ON 15/04/2017 BY 3DWANNAB ; Reason for creating this, was to learn and create a LISP that I use on a regular basis. ; Commandline Syntax: Type "Leader_To_Multileader" OR "LTM" to run Program. ; ; ADDED - Case Conversion. ; OPTIONS: ; Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase. ; ; ADDED - Annotation support. Program simply matches the (entget) object to that of the (entlast) object. With the help of AT:isAnnotative written by Alan J. Thompson. ; ADDED - Custom LM:ssget fn written by LeeMac. ; ADDED - Multiple Selection. User can now select the LEADER and MTEXT together and no longer individually resulting in a much faster conversion. ; ADDED - Round off points - To nearest round number. That been 1. round fn written by Doug Broad. Additional credits to Joe Burke, Peter Toby. ; ADDED - Strip MTEXT - Of formatting option - LM:UnFormat fn written by LeeMac. ; ADDED - Text Rotation - MTEXT rotation is now preserved. ; ADDED - Undo levels - As opposed to one command at a time. ; ADDED - Picking of existing MLEADER to use as new style. ; RMB-SPACEBAR-ENTER to skip this step and use the current MLEADER style ; SETTINGS TRANSLATED IF PICKED: ; (vla-put-Layer newmleader existingMlLayer) ; (vla-put-ScaleFactor newmleader existingMlScale) ; (vla-put-StyleName newmleader existingMlStyle) ; (vla-put-TextWidth newmleader existingMlWidth) ; ; SETTINGS TRANSLATED IF NOT: ; (vla-put-Layer newmleader existingTxtLayer) ; (vla-put-TextRotation newmleader existingTxtRot) ; (vla-put-TextWidth newmleader existingTxtWidth) ; ; CHG - Changed to 'vla-get-TextString' as more robust. ; CHG - Moved new MLEADER to TEXT Layer as opposed to existing LEADER. ; CHG - Picking never fails, prompts user to keep picking until successful. LM:SelectIf fn written by LeeMac. ; FIX - ACADs built in functions to convert ill-formatted MTEXT creates a bug in the string result. LM:StringSubst by LeeMac. ; FIX - End position of MLEADER. ; FIX - Z coordinate to 0, resulting in no fuzzy text. ; FIX - Forces the MLEADER to be created from the 'LEADER arrowHead first' resulting in correct results all the time. ; FIX - Vertices, Leader_To_Multileader now supports 2 or 3 points. ; If 2 (Straight) it straightens the MLEADER up to the Y axis of the LEADER point for those LEADERS at an angle. ; If 3 (Dog Legged) it recreates those as they originally were. ; If <3 (Multiple) it recreates the 1st, 2nd & end point point of the original LEADER. The 4th vert or more, will get removed. ; NOTE: Not really any need for more than 3 points on an MLEADER, I don't think. ; ;;; KNOWN QUIRKS, BUGS ; Works in different UCSs, if you are fixing MTEXT & LEADERS which are upside down then the new MLEADER might be a little wacky. ; ;;; FUTURE ADDITIONS ; Convert based on how close the LEADER and MTEXT are away from each other. To enable multiple selection. ; ;;; COMMENT OUT ; First off, Big THANKS to Lyle Hardin for the original code. ; Big THANKS to LeeMac for the functions he has put up on his website. ; Finally getting the basics of this LISP'ing lark thanks to guys like him. ; Lots of other places on forums and Users too. To many users to mention. ; Let me know your thoughts on this Program or if you want to drop a Thank you. ; e. stephensherry147@yahoo.co.uk (defun c:LTM nil (c:Leader_To_Multileader)) (defun c:Leader_To_Multileader ( / *error* cmde entLeader entLeaderName entTxt entTxtName entTxtVlaObj existingMlScale existingMlStyle existingMlvlaObj existingMlWidth existingTxtLayer existingTxtRot existingTxtString existingTxtWidth ldxf10_1 ldxf10_2 ldxf10_last lstleaderlen lstleaderpts os ss1 ss2 ) (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>")) ) (setvar 'cmdecho cmde) (setvar 'osmode os) ) (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) (setq cmde (getvar "cmdecho")) (setq os (getvar "osmode")) (setvar 'cmdecho 0) (setvar 'osmode 0) (if (setq ss1 (car (LM:SelectIf (strcat "\nSelect an existing MULTILEADER to use as the new style\nor RMB-SPACEBAR-ENTER to use current: '" (getvar "cmleaderstyle") "'." ) (lambda ( x ) (eq "MULTILEADER" (cdr (assoc 0 (entget (car x)))))) entsel nil ) ) ) (progn (setq existingMlvlaObj (vlax-ename->vla-object ss1) existingMlLayer (vla-get-Layer existingMlvlaObj) existingMlStyle (vla-get-StyleName existingMlvlaObj) existingMlWidth (vla-get-TextWidth existingMlvlaObj) ) (if (/= T (AT:isAnnotative ss1)) (setq existingMlScale (vla-get-ScaleFactor existingMlvlaObj)) ) (princ (strcat "\nStyle to use: ' " existingMlStyle " '")) ) ) (initget "Titlecase Lowercase Uppercase Sentencecase toGglecase Keepcase") (setq ansCase (cond ( (getkword (strcat "\nChoose Text Case : [Title case/Lower case/Upper case/Sentence case/toGgle case/Keep case] <" (setq ansCase (cond ( ansCase ) ( "Keepcase" )) ) ">: " ) ) ) ( ansCase ) ) ) (initget "Keepformatting Removeformatting") (setq ansFromatting (cond ( (getkword (strcat "\nChoose Formatting : [Keep formatting/Remove formatting] <" (setq ansFromatting (cond ( ansFromatting ) ( "Keepformatting" )) ) ">: " ) ) ) ( ansFromatting ) ) ) (while (setq ss2 (LM:ssget "\nSelect 1 LEADER & 1 MTEXT: " (list "_:L" (append '( (-4 . "<OR") (0 . "MTEXT") (0 . "LEADER") (-4 . "OR>") ) ) ) ) ) (if (/= (sslength ss2) 2) (progn (alert "Select only 1 MTEXT and 1 LEADER.") (princ " >>> 'LTM' failed selection, try again ...")(princ) ) (progn (if (= (cdr (assoc 0 (entget (ssname ss2 0)))) "LEADER") (setq entLeader (entget (ssname ss2 0)) entTxt (entget (ssname ss2 1)) ) (setq entLeader (entget (ssname ss2 1)) entTxt (entget (ssname ss2 0)) ) ) (if (or (and (eq (dxf 0 entLeader) "LEADER") (eq (dxf 0 entTxt) "LEADER")) (and (eq (dxf 0 entLeader) "MTEXT") (eq (dxf 0 entTxt) "MTEXT"))) (progn (alert "Please, check your Selection !\n\nSelect only 1 MTEXT and 1 LEADER.") (princ " >>> 'LTM' failed selection, try again ...")(princ) ) (progn (setq entLeaderName (dxf -1 entLeader) entTxtName (dxf -1 entTxt) existingTxtLayer (dxf 8 entTxt) entTxtVlaObj (vlax-ename->vla-object entTxtName) existingTxtString (vla-get-TextString entTxtVlaObj) existingTxtWidth (dxf 41 entTxt) existingTxtRot (dxf 50 entTxt) lstleaderpts (vl-remove-if-not '(lambda (p) (eq (car p) 10)) entLeader ) lstleaderlen (length lstleaderpts) ldxf10_1 (cdr (car lstleaderpts)) ldxf10_1 (mapcar '(lambda (x) (round x 1) ) ldxf10_1 ) ldxf10_2 (if (>= lstleaderlen 3) (cdr (nth (- lstleaderlen 2) lstleaderpts)) ) ldxf10_2 (mapcar '(lambda (x) (round x 1) ) ldxf10_2 ) ldxf10_last (if (< lstleaderlen 3) (list (car (dxf 10 entTxt)) (cadr ldxf10_1) (caDDr (dxf 10 entTxt))) (list (car (dxf 10 entTxt)) (cadr ldxf10_2) (caDDr (dxf 10 entTxt))) ; (list (car (dxf 10 entTxt)) (cadr ldxf10_1) 0) ; (list (car (dxf 10 entTxt)) (cadr ldxf10_2) 0) ) ldxf10_last (mapcar '(lambda (x) (round x 1) ) ldxf10_last ) ) (cond ((= "Keepformatting" ansFromatting) ) ((= "Removeformatting" ansFromatting) (setq existingTxtString (LM:UnFormat existingTxtString nil)) ) ) (progn (if (>= lstleaderlen 3) (progn (command "._MLEADER" "_L" "_H" "_O" "_M" 3 "_A" "_N" "_X" "_non" (trans ldxf10_1 0 1) "_non" (trans ldxf10_2 0 1) "_non" (trans ldxf10_last 0 1) "") ) (progn (command "._MLEADER" "_L" "_H" "_O" "_M" 2 "_A" "_N" "_X" "_non" (trans ldxf10_1 0 1) "_non" (trans ldxf10_last 0 1) "") ) ) (setq newmleader (vlax-ename->vla-object (entlast))) (cond ((= "Titlecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "TITLE")) ) ((= "Lowercase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "LOWER")) ) ((= "Uppercase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "UPPER")) ) ((= "Sentencecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "SENTENCE")) ) ((= "toGglecase" ansCase) (setq existingTxtString (acet-tcase-change-string existingTxtString "TOGGLE")) ) ((= "Keepcase" ansCase) (setq existingTxtString existingTxtString) ) ) (setq existingTxtString (LM:StringSubst "\\\H" "\\\h" existingTxtString)) (vla-put-TextString newmleader existingTxtString) (vla-put-TextRotation newmleader existingTxtRot) (if ss1 (progn (command "._MATCHPROP" ss1 (entlast) "") (vla-put-TextWidth newmleader existingMlWidth) ; (vla-put-StyleName newmleader existingMlStyle) ; (vla-put-Layer newmleader existingMlLayer) (if (/= T (AT:isAnnotative ss1)) (vla-put-ScaleFactor newmleader existingMlScale) ) ) (progn (vla-put-Layer newmleader existingTxtLayer) (if (/= existingTxtWidth 0) (vla-put-TextWidth newmleader existingTxtWidth) ) ) ) (command "_.erase" entTxtName "") (command "_.erase" entLeaderName "") (command "_.move" (entlast) "" '(0 0 1e99) "" "_.move" "_p" "" '(0 0 -1e99) "") (princ " >>> 'LTM' has done the business ...")(princ) ) ) ) ) ) ) (*error* nil) (princ) ) ;; Unknown Autor (defun dxf (code elist) (cdr (assoc code elist)) ) ;; Doug Broad ;; additional credits Joe Burke, Peter Toby (defun round (value to) (setq to (abs to)) (* to (fix (/ ((if (minusp value) - +) value (* to 0.5)) to))) ) ;;--------------------=={ String Subst }==--------------------;; ;; ;; ;; Substitutes a string for all occurrences of another ;; ;; string within a string. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; new - string to be substituted for 'old' ;; ;; old - string to be replaced ;; ;; str - the string to be searched ;; ;;------------------------------------------------------------;; ;; Returns: String with 'old' replaced with 'new' ;; ;;------------------------------------------------------------;; (defun LM:StringSubst ( new old str / inc len ) (setq len (strlen new) inc 0 ) (while (setq inc (vl-string-search old str inc)) (setq str (vl-string-subst new old str inc) inc (+ inc len) ) ) str ) ;; ssget - Lee Mac ;; A wrapper for the ssget function to permit the use of a custom selection prompt ;; ;; Arguments: ;; msg - selection prompt ;; params - list of ssget arguments (defun LM:ssget ( msg params / sel ) (princ msg) (setvar 'nomutt 1) (setq sel (vl-catch-all-apply 'ssget params)) (setvar 'nomutt 0) (if (and sel (not (vl-catch-all-error-p sel))) sel ) ) ;;---------------------=={ Select if }==----------------------;; ;; ;; ;; Provides continuous selection prompts until either a ;; ;; predicate function is validated or a keyword is supplied. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; msg - prompt string ;; ;; pred - optional predicate function [selection list arg] ;; ;; func - selection function to invoke ;; ;; keyw - optional initget argument list ;; ;;------------------------------------------------------------;; ;; Returns: Entity selection list, keyword, or nil ;; ;;------------------------------------------------------------;; (defun LM:SelectIf ( msg pred func keyw / sel ) (setq pred (eval pred)) (while (progn (setvar 'ERRNO 0) (if keyw (apply 'initget keyw)) (setq sel (func msg)) (cond ( (= 7 (getvar 'ERRNO)) (princ "\nMissed, Try again.") ) ( (eq 'STR (type sel)) nil ) ( (vl-consp sel) (if (and pred (not (pred sel))) (princ "\nInvalid Object Selected.") ) ) ) ) ) sel ) ;;-------------------=={ UnFormat String }==------------------;; ;; ;; ;; Returns a string with all MTEXT formatting codes removed. ;; ;;------------------------------------------------------------;; ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;; ;;------------------------------------------------------------;; ;; Arguments: ;; ;; str - String to Process ;; ;; mtx - MTEXT Flag (T if string is for use in MTEXT) ;; ;;------------------------------------------------------------;; ;; Returns: String with formatting codes removed ;; ;;------------------------------------------------------------;; (defun LM:UnFormat ( str mtx / _replace rx ) (defun _replace ( new old str ) (vlax-put-property rx 'pattern old) (vlax-invoke rx 'replace str new) ) (if (setq rx (vlax-get-or-create-object "VBScript.RegExp")) (progn (setq str (vl-catch-all-apply (function (lambda ( ) (vlax-put-property rx 'global actrue) (vlax-put-property rx 'multiline actrue) (vlax-put-property rx 'ignorecase acfalse) (foreach pair '( ("\032" . "\\\\\\\\") (" " . "\\\\P|\\n|\\t") ("$1" . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]") ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);") ("$1$2" . "\\\\(\\\\S)|[\\\\](})|}") ("$1" . "[\\\\]({)|{") ) (setq str (_replace (car pair) (cdr pair) str)) ) (if mtx (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str)) (_replace "\\" "\032" str) ) ) ) ) ) (vlax-release-object rx) (if (null (vl-catch-all-error-p str)) str ) ) ) ) ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-annotative-using-lisp-or-vlisp/m-p/3266716#M301077 ;; Check if entity is annotative and which accounts for objects that were once annotative but are no longer. ;; ename - ename to check (returns T if annotative) ;; Alan J. Thompson (defun AT:isAnnotative (ename / check) (and (setq check (cdr (assoc 360 (entget ename)))) (setq check (dictsearch check "AcDbContextDataManager")) (setq check (dictsearch (cdr (assoc -1 check)) "AcDb_AnnotationScales")) (assoc 350 check) ) ) ;; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/set-annotative-using-lisp-or-vlisp/m-p/3266684#M301075 ;; By User pbejse ;; (IsAnno-p ;; (setq itm (vlax-ename->vla-object (Car (entsel)))) ;; ) (defun IsAnno-p (ent / exd ano) (vl-load-com) (and (eq (vla-get-HasExtensionDictionary ent) :vlax-true) (setq exd (vla-GetExtensionDictionary ent) exd (vla-item exd "AcDbContextDataManager") ano (vla-item exd "ACDB_ANNOTATIONSCALES") ) (not (zerop (vla-get-Count ano))) ) ) (load "TcaseSup.lsp") (vl-load-com) ;; End (princ (strcat "\n:: Leader_To_Multileader.lsp edited on " (menucmd "m=$(edtime,0,DD-MO-yyyy)") " by 3dwannab (stephensherry147@yahoo.co.uk) loaded ::" "\n:: Type \"Leader_To_Multileader\" OR \"LTM\" to run Program ::" ) ) (princ) MLEADER Test Drawing.dwg
  10. Hey guys, I have a client who uses autovue to open and print their drawings. One issue we've run into is that the multileaders that have background masks on them, no matter the colour, end up showing black and blacking out the information when it's printed. All other masks/wipeouts print ok except for the multileader ones. Do any of you guys have experience with this? Thanks, JT
  11. Hi I have a multileader with a block The problem is when i go to move the block part of the multileader it jumps all over the place sometimes, usually if it is directly above or below the leader. MultiLeader with block does not move to insertion point.dwg I think it is because it is trying to find an attachment to left or right. I just annoying
  12. Hey guys, So, is it possible to have a lisp that automatically labels a block based on an attribute? Ideally, it would also be a field so that if the attribute changed, the mulitleader text would as well. For example, let's say I have a dynamic block for an Oak Tree, which has three sizes: 2", 3", & 4". It'd be great if I could run a LISP that would create a multileader that read " 2"-Oak Tree ". It'd be doubly great if the 2" part of that was a field that updated if the dynamic block was changed to its 4" state. For reference, this wonderful Lee Mac LISP is what I currently use for my labeling and it's brilliant. Ideally, I'll end up combining the attribute/field labeling component with this lisp somehow. Lastly, I'm not great at all with writing LISPs, but I'd like to figure out how this one would work so that I can modify it as need be on my own. Thanks for any help!
  13. Hi. I'm trying to create a block-based multileader style in ACAD 2014 LT, but I'm running in a weird color behavior issue. below is the block used as the base as seen in block editor : The issue arise with the hatch. I've been using a version without a hatch for a long time without any issues ever, but I would like to have hatch so that I don't have to trim overlapping lines or add boundaries to background hatches, which make any kind of afterthought modifications a pain. In model space, everything seems fine : But when seen in paper space, the hatch suddenly takes the layer color (in this case, blue). It's the same wether the multileader is copied directly on the paper or viewed through a viewport. Why is this happening and is there a workaround? I can't use a wipeout because for some reason, I can't do an ellipsoid wipeout and you can't make an ellipse with polyline arcs. Thank you
  14. Hey guys! So the amazing Lee Mac wrote two different versions of a LISP based on a request I posted. Workflow demands have changed and now I need to modify the lisp to be somewhere in between the two versions. Version 1 & Version 2. For the combo lisp, I need: The block multileader to populate from the block's description, rather than name (like it does in Version 1). If there is no description, then the contents should default on block name (not from either version, but it would be helpful. I'm not sure how tricky it would be to code) The block multileader to automatically start at the block's insertion point (like it does in Version 2). The hatch multileader component is perfect in both versions (pulling the name and prompting for first click as insertion point) I tried fiddling around with it, but am too much of a noob to really make heads or tails of what's going on between the two versions (to my amateur eyes, the methods used between the two are too different for me to reconcile). Thanks for any help!
  15. Hi, I am trying to fully customize AutoCAD in my daily work. Successfully I've managed to to override double click action for block with attributes, so now, when i click on some specific named block I have my own VBA form working (not a standard attribute editor window). But problem occurs when I am trying to do the same for multileader with block. When I've changed macro for double click on multileader it is showing only when you double click on leader itself, but when you double click the block in multileader - AutoCAD is still opening attribute editor window. When I've changed the macro for all possible block double clicks - it doesn't work as well. For Autocad still I am double clicking on multileader - BUT - after that, somehow it opens block editor - when it is specified in multileader. Does anyone have the solution here? Thanks for help!
  16. Hey guys, first time posting so forgive (and gently correct) any lapses in forum etiquette. So basically I'm trying to automate labeling landscape plans. Looking for a pain-free way to slap an accurate multileader on clusters of blocks, the original of which will have been pulled from a palette. I know what you’re thinking—just use a block name->mleader LISP. Whale, our block names are written in a slightly different format than the desired leader text, for easier lookup. EG: •Block name: Oak-Red •Mleader text: X-Red Oak So an ideal solution: •Needs to pull from palette block description or some attribute other than block name •Needs to be palette-friendly This LISP is really great. BUT, we make our palettes by wblocking each block to its own drawing and then dragging all of those separate drawings into the palette (any other way and the palette moves ridiculously slow). WB saves the block as a drawing and removes block description, meaning the LISP doesn’t work on blocks taken from the palette . So, do y’all know how to rewrite this LISP (is that even allowed—rewriting someone else’s LISP? Sorry, newbie here) to pull the description from the palette display (which I would go through and input) _or_ to retain the original block description through the WB process? Unless y’all can come up with something clever, my workaround is going to be to change the block name to the desired Mleader text (X-Red Oak) and then change the block display name in the palette for easy look-up (Oak-Red), and then use a block name->mleader LISP. This works, but is not ideal—would take an obnoxious amount of time and they’d see “X-Plant Name” when doing bcount (not a huge deal). HALP and thanks!
  17. Hi, I searched and found some code on here that did not go as deep as I need it to. A few weeks ago I made a multileader with the hexagon and enabled the large dot on the end of the leader, it was MLS "STANDARD", my first mistake. But 1st, I customized the _TagHexagon so it had a masked mtext attribute. At the time I didn't know that Quick Select and Object Selection Filters did not differentiate between home made mleaders and mleaders with mtext and a simple leader. The reason I need to separate them, sometimes I come into a dwg and all the MLs are linespace factor of 1, I want to grab them all with a filer and make them .9, looks so much better, but it also grabs my custom MLs because I left the style name as STANDARD, once they are all selected, the properties fields will not show the "line space factor" field so I have to pick each mleader, and there are a lot of them! There's nothing else unique to filter, all on layer TEXT, BYLAYER, etc. Has anyone written code to select STANDARD AND Hexagon? Or STANDARD AND MLs with leaders with dots, OR filled arrow heads etc? I am not great at lisp but I can tweak it, insert names of my own styles, blocks etc. In the mean time, I will make my new custom MLs with Color White or put the 1st one in the dwg on a different layer but I have made 30 dwgs full of these mixed MLs. Thanks much if you can help! BTW, I'm using Acad 2014 -=(RLH)=-
  18. Multileader copy and paste is no longer working, and I don't know how to make a multi leader that looks like the following: (With a circle around the text). I originally copied and pasted it from another drawing, but that is nolonger working. I can click the object (to make it dashed as selected), copy, select start point, enter, but when I click a destination point nothing happens. How do I make another one of these? (I have AUTOCAD 2013)
  19. Is it possible to change the multileader text from Lower case to upper case all at once? rather change one by one. Thanks
  20. Whenever I try to add another leader to my vertex, it usually jumps to the end of the line. Any way to make ALL leader arrows come out of the same vertex? Do I need to adjust my mleaderstyle settings? PS- I recorded a GIF with LICEcap but the File Upload Manager on Cadtutor uploads it as a JPG for some reason.
  21. We're looking at implementing multileaders instead of quleaders in my office, and so I've been tasked with figuring out how to do it (being as I am the least senior, most peon-ish person in my department). I've messed with them before, so I mostly have it figured out. There is one thing that eludes me- despite much Googling and AutoCADding for Dummies and (the most worthless of all) AutoCAD's F1. My question is: when mleaders are annotative, where do you set the 'paper space text height'? I know I can change the model space text height (among other things) through Properties, but that seems to defeat the purpose of having annotative properties.
  22. I am setting up some architectural Multileader Styles to pull into various drawings as needed from the Designcenter. I have created 7 different scales of Multileaders and set their Text "Left and Right Attachments" to "Middle of top line". When I pull the styles into a drawing, the "Left Attachment" is true and is at the middle of the top line. However when I make a right attachment the multileader randomly decides to "Underline top line". I have thought of everything I can to try and fix it in the original file referenced from the designcenter...both attachments say "Middle of top line". I have overwrote the Styles in the file and saved things and closed down things and restarted things. lol I'm at a loss and so any help would be appreciated. Along the same lines - for these multileader styles I am creating, how can I get rid of default text? I would like to be able to just click the multileader tool, place it in my drawing, and begin typing - but somehow I cannot get rid of the "Contents" - or - "Default Text" because AutoCAD asks me if I want to overwrite the default text when I place it - in which I would always like to overwrite it so i'd rather have no default text and just be able to type asap. lol Thanks,
  23. I'm wondering if there is a way that you can have a non-rectangular border (circle, ellipse, hex, etc) around text in a multileader. I only see an option for a default rectangular border under multileader options. I tried making a multileader with a hex drawn around the text, anchored at the landing by a corner, and then centered the text on the hex by manipulating the landing gap. I then tried WBLOCKing the whole thing into an enhanced attribute. It did not work- the multileader lost all editing / moving ability until I exploded it again. Part two if this question: how would one do this if the multileader were to be annotative? Seems to me that even if my WBLOCK idea had worked, the hex or whatever wouldn't have scaled right with the multileader text anyway if the anno scale changed too much...
  24. chiimayred

    Working Point Lisp

    Hey guys, I'm trying to make a lisp where the user would pick a point in the model and the lisp would create a multileader in paperspace with the coordinates pulled from the model. Here's the code I got so far: (defun c:test (/ WorkingPoint Easting Northing Point) (command "_.mspace" );;end command (setq WorkingPoint (getpoint "\nWhere is Working Point?: ")) (setq Northing (cadr WorkingPoint));;set "y" value of WorkingPoint to Northing (setq Easting (car WorkingPoint));;set "x" value of WorkingPoint to Easting (command "_.point" WorkingPoint );;end command (setq point (entlast));;set the workingpoint to point (command "_.chspace" point "" "" );;end command (setq pspaceworkingpoint (entget point)) (setq mleaderinspt (list (car pspaceworkingpoint)(cadr pspaceworkingpoint))) (princ mleadinspt) );;end defun Whenever I run this, for the "mleaderinspt" variable I get nilnil What I want to do is create the multileader insert point where the user picked the original working point but I'm having a hard time translating that to the paperspace. Please note I haven't added error checking yet as this is still in the developmental phase/proof of concept. Any and all help is appreciated. Thanks! EDIT: Think I figured it out, I'll update this thread if it works.
  25. Hello, This is outside my normal LISPing and I am in need so some advice. My goal is to create (or modify) a multileader leader and landing line so they can be used to add perpendicular leaders to opposing sides of drawing features, as seen in the attached image. The reason for this is to improve the clarity of labeling (by having an additional leader style. I am not sure if this can be completed via LISP or a .net approach must be taken. Can anyone provide any advice? Thanks David
×
×
  • Create New...