
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am not familiar with LISP en basiccally familiar with VB, but with help from all you guys on differtne forums I already put together some routines to ease up my work. But now I'm stuck.
I'm trying to fill a part of the current drawingname into the custom props of the drawing. For example:
dwgname = 2002020_20200904 (first part is the project number, second part is the drawing date.
In the props I want to create a custom property called Projectnr, filled with (in this example) 20-02020.
I found a LISP:
(defun c:dProps (/ dProps dProp)
(vl-load-com)
(setq acadObject (vlax-get-acad-object))
(setq acadDocument (vla-get-ActiveDocument acadObject))
;;Get the SummaryInfo
(setq dProps (vlax-get-Property acadDocument 'SummaryInfo))
;; remove custom infos
(repeat (setq n (vla-NumCustomInfo dProps))
(vla-RemoveCustomByIndex dProps (setq n (1- n)))
)
;;Add an entry to the "Custom" tab
(vla-addcustominfo dProps "Projectnr" (vl-filename-base (getvar "dwgname")))
(princ)
)
This basically does the job but I get the full name (2002020_20200904), where I want 20-02020.
Am I walking in the right direction or are there better ideas?
Solved! Go to Solution.