See the top rated post in this thread. Click here

Results 1 to 6 of 6

Thread: Change Visibility of Dynamic Block Using Sheet Set Field

  1. #1
    Member
    Join Date
    2009-05
    Posts
    32
    Login to Give a bone
    0

    Default Change Visibility of Dynamic Block Using Sheet Set Field

    Does anyone know of a way to change the visibility of a dynamic block using a field from sheet set manager? I have a title block that has several logos in it. I have it set as a block with a visibility parameter right now, and I would like to control that visibility somehow with a field from the sheet set manager. That way, I can have it change on the fly without having to go to each sheet when I need to. Thanks in advance for any help you can offer.

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Change Visibility of Dynamic Block Using Sheet Set Field


  3. #3
    Member
    Join Date
    2009-05
    Posts
    32
    Login to Give a bone
    0

    Default Re: Change Visibility of Dynamic Block Using Sheet Set Field

    RenderMan thank you ever so much for your guidance, I just read both of those threads in their entirety, and understand that it can be done. Unfortunately, I do not know how to code lisps, therefore, it looks as if:

    1. I am out of luck with doing this myself, I will have to find someone else to do it.
    2. I need to find another way to do this that does not involve programming, in which case, I am probably in the wrong forum.

    If option number 2 is my best case scenario, can someone point me in the direction of the correct forum.

    ** update** I have just found the dynamic blocks technical forum........... imagine that. It was way too obvious.
    Last edited by seneca06; 2012-07-07 at 06:33 PM. Reason: found another route

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Change Visibility of Dynamic Block Using Sheet Set Field

    You're welcome; glad you found what you were looking for in the other forum.

  5. #5
    Member
    Join Date
    2006-07
    Posts
    16
    Login to Give a bone
    0

    Default Re: Change Visibility of Dynamic Block Using Sheet Set Field

    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


    cheers
    Justin

  6. #6
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    1

    Default Re: Change Visibility of Dynamic Block Using Sheet Set Field

    Quote Originally Posted by cad user View Post
    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
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Similar Threads

  1. Replies: 3
    Last Post: 2015-05-11, 06:13 PM
  2. Replies: 1
    Last Post: 2014-11-20, 12:27 AM
  3. Replies: 2
    Last Post: 2013-06-04, 02:59 AM
  4. Change dynamic block visibility with command line or lisp
    By gjp in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2009-06-11, 07:23 PM
  5. Replies: 3
    Last Post: 2006-07-20, 07:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •