Many ways to import blocks from a drawing with a list of known blocks so I'll offer two more.
Open Design Center with MUTCD.dwg with macro:
Code:
^C^C^P(command "adcnavigate" "G:/ENGDESGN/BeaufordT/Blocks/MUTCD.dwg")
Open Blockspalette to Typicals.dwg:
Code:
^C^C-blocknavigate;"G:/ENGDESGN/BeaufordT/Blocks/Typicals/Typicals.dwg";_blockspalette
With either of these you can pick the block you want from those displayed in a window.
To insert a ScaleBar matching current Annotation scale:
Code:
^C^C^P(or C:ScaleBarIns (load "ScaleBarIns.lsp"));ScaleBarIns
Code:
(defun c:ScaleBarIns (/ Trim0s bNameLoc InsScl InsPt Rot bName Clayer )
(defun Trim0s (xb) ; Thank ronjonp
(if (= (type xb) 'real); Trim 0's from end of string conversion, then trim . if it's at the end afterwards.
(vl-string-right-trim "." (vl-string-right-trim "0" (vl-princ-to-string xb)))
(itoa xb); if integer convert to string without trimming 0's from end.
)
)
(if (= 1 (getvar 'cvport))(command-s "MSPACE"))
(load "GetBlock.lsp")
(setq bNameLoc (strcat (vl-filename-directory (findfile "VDOT.LSP")) (chr 92) "Scales2.dwg")
InsScl (Trim0s(/ 1(vla-get-CustomScale (vla-get-ActivePViewport (vla-get-activedocument (vlax-get-acad-object))))))
InsPt (getvar "viewctr")
Rot (if(zerop (getvar 'worlducs))0(/ (* 180 (- (getvar "viewtwist"))) pi))
bName (strcat "Scale" InsScl "-2")
Clayer (getvar 'clayer)
)
(princ "\nRot = ")(princ Rot)
; -INSERTCONTENT
; https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2021/ENU/AutoCAD-Core/files/GUID-B5D64510-561E-4FA9-8AD6-625445CCD81F-htm.html
(or (tblsearch "BLOCK" bName)(GetBlock bNameLoc bName))
(if (tblsearch "BLOCK" bName)
(progn
(setvar 'clayer (strcat "Scale" InsScl))
(command-s "-INSERT" bName "R" Rot "S" 1 (getpoint "ScaleBar insertion point: "))
); progn
(princ (strcat "\nSorry no ScaleBar for viewport scale of " InsScl "."))
); if (tblsearch "BLOCK" bName)
(setvar 'clayer Clayer)
(princ)
)
Other than that I usually use Lee Mac's Steal From Drawing which allows you to import groups almost anything from other drawings.
The user may choose multiple items from a list of:
- Blocks
- Layers
- Linetypes
- Dimension Styles
- Text Styles
- Table Styles
- MLeader Styles
- MLine Styles
- Layouts
- Page Setups
- User Coordinate Systems
- Groups
- Views
- Layer States
- Scales
- Materials
- Viewports
- Drawing Properties
- Custom Properties
I use it everyday, thanks Lee!