1
AutoLISP (Vanilla / Visual) / Re: purge everything but layers
« Last post by BIGAL on May 15, 2024, 08:18:55 PM »If you are using CIV3D run Purgestyleandsettings maybe twice before normal purge. It makes a big difference.
As an aside, note that the purgeall method will also skip Multileader Styles when purging a drawing - this is a known bug.Wow, 12 years on and this bug remains.
;; Purge using vla and normal method to purge MULTILEADERS as there's a bug with that using the vla method.
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(repeat 3 (vla-purgeall doc))
; Purge MULTILEADERS (no prompt), the above code doesn't purge MULTILEADERS. Known bug: https://www.theswamp.org/index.php?topic=42854.msg480733#msg480733
(command "_.PURGE" "_MU" "*" "_N")
I believe this would be the same concept as hard-coding it into our acad.lsp file
;;----------------------------------------------------------------------;;
;; setPlotStyle FUNCTION
;; https://www.theswamp.org/index.php?topic=45000.msg502065#msg502065
;; Added checking if the plot style exists by 3dwananb on 2024.05.15
(defun setPlotStyle (ctb / CurDoc installedPs)
(setq CurDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq installedPs (vlax-safearray->list (vlax-variant-value (vla-GetPlotStyleTableNames (vla-get-ActiveLayout CurDoc))))) ;;get the plotstyles
(if (/= nil (vl-position ctb installedPs))
(progn
(princ (strcat "\nPlot Style successfully set to: '" ctb "'\n"))
(vlax-map-collection
(vla-get-Layouts
(vla-get-ActiveDocument (vlax-get-acad-object))
)
'(lambda (x) (vla-put-StyleSheet x ctb))
)
)
(princ (strcat "\nPlot Style '" ctb "' not found!\n"))
) ;; if verify if the plotstyle exist, if not, print to the commandline.
)
(setPlotStyle "monochrome.ctb")
Do you need to use MS Graph? If not you could build your own simple web server on the company intranet or host it in the cloud. Something like Go with SQLite db would be easy enough to setup, you could even register it and then use it with the MS Graph api to get extra data if needed.^^^ I believe this would be the same concept as hard-coding it into our acad.lsp file. It would still need updated by me, but I'd rather have it come from Graph since IT has to update these profiles already anyways
Of course, the conspiracist in me immediately thought, scan employee emails and feed them to an AI to build profilesThat would be bonkers. Plus, that's what Copilot M365 is for yeah?