I am trying to create a reactor which get triggered when using SAVE (SAVEAS). When the dialog for filename and path has passed, is there a way to 'read' the chosen filename and path and filter it for specific content? Is this stored somewhere?
What I have is this:
(setq d2_reactor_2404_01
(vlr-dwg-reactor
"Save Complete"
'((:vlr-SaveComplete . DoThisAfterSave)
)
)
) ; end setq
(setq savebegin-reactor
(vlr-dwg-reactor
"Save Begin"
'((:vlr-BeginSave . switchbackground))
)
) ; end setq
(defun switchbackground (calling-reactor commandInfo /)
(if (vl-string-search "blocks" <path to save>)
(progn
(vla-put-GraphicsWinModelBackgrndColor disp newColr)
(setq col_ch 1)
) ; end progn
) ; end if
) ; end defun
(defun DoThisAfterSave (Caller1 CmdSet1)
(prinx "\nTekening opgeslagen!")
(setq is_save T
is_open nil
)
(if (eq col_ch 1)
(progn
(vla-put-GraphicsWinModelBackgrndColor disp oldColr)
(prinx " en weer terug naar orginele kleur...")
) ; end progn
) ; end if
) ; end defun
What it must do is the following:
The Model drawing background is grey. When the user creates a drawing in the project-path, the background stays grey. If the user creates a block in the library-path (g:\acad\blocks\...) the background is set to white, it saves the drawing and turns the backgroundcolor back to the original grey.
Why do I want this? In AutoCAD 2013 a drawing with a black or grey background is displayed in the designcenter with black or grey background. If I save it with white, in designcenter it becomes white.
Or is there an other way to accomplish this?