Originally Posted by
cad user
Hi Sceneca06 did you find what you where lookning for on the other thread? I am trying to do the same (manage visibility states of dynamic blocks from the sheet set manager) and cant find any info on the forums
The only way this can be done is with custom code.
Being that the Sheet Set Manager (SSM) API is only exposed to VBA & .NET, you're limited in your approach when using Visual LISP.
One way with Visual LISP, is to implement an Object Reactor that monitors the TextString Property of the nested Attribute within your title block that is meant to 'trigger' the change in Visibility State. The problem being that the Attribute is populated with a Field, the TextString Property is only updated in accordance with the FIELDEVAL System Variable, and not when one modifies SSM Property that is referenced via said Field. To monitor the SSM events directly, you'd need to use VBA or .NET API, even if only to develop the necessary LispFunction Methods.
It would be far simpler to instead simple add a Command Reactor that is raised when the REGEN, etc. Command(s) are complete (see :vlr-CommandEnded event). Here's a quick sample that only monitors a few of the Commands associate with the FIELDEVAL System Variable to demonstrate the concept:
Code:
(vl-load-com)
(defun c:SampleReactorStart ()
(or
*SampleCommandReactor*
(setq *SampleCommandReactor*
(vlr-command-reactor
"Regen Reactor"
'(
(:vlr-commandended . SampleCallback:CommandEnded)
)
)
)
)
(prompt "\nSample command reactor loaded. ")
(princ)
)
(defun SampleCallback:CommandEnded (rea cmd)
(if
(wcmatch (strcase (car cmd)) "*ETRANSMIT,*OPEN,*PLOT,*REGEN,*SAVE*")
(prompt "\n** Update visibility state ** ")
)
)
(defun c:SampleReactorStop ()
(if *SampleCommandReactor*
(progn
(vlr-remove *SampleCommandReactor*)
(setq *SampleCommandReactor* nil)
(prompt "\nSample command reactor stopped. ")
)
)
(princ)
)
(c:SampleReactorStart)
(princ)
Simpler still, is to instead implement Menu, and Ribbon dropdown that calls a LISP supplying the desired Visibility State as parameter, which programmatically modifies your title block, and you reside yourself that this is a once in a while necessity when updating that specific property in SSM (if manually changing the Visibility State is for some reason insufficient as a secondary step).
Cheers