• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Dynamic Blocks

    Reply
    Active Member
    johnfraser
    Posts: 9
    Registered: ‎10-25-2011

    Re: You gotta try visibility-add-eng-v1.1

    10-30-2011 01:40 PM in reply to: Charles_Shade

    I used 2011 to make my block (I have both installed on my PC). But thanks for the heads up anyways.

    Please use plain text.
    Valued Contributor
    Posts: 56
    Registered: ‎06-27-2006

    Re: You gotta try visibility-add-eng-v1.1

    11-29-2011 12:13 AM in reply to: Charles_Shade

    There is a new version supporting AutoCAD 2012 (and previous):

    http://poleshchuk.spb.ru/cad/Download/visibility-add-eng-v1.5.zip (English)

    http://poleshchuk.spb.ru/cad/Download/visibility-add-rus-v1.5.zip (Russian)

     

    Please try and give feedback.

     

    Nikolay Poleshchuk
    http://poleshchuk.spb.ru/cad/eng.html
    Please use plain text.
    *Expert Elite*
    Charles_Shade
    Posts: 6,975
    Registered: ‎04-10-2005

    Re: You gotta try visibility-add-eng-v1.1

    11-29-2011 05:02 AM in reply to: NikolayPoleshchuk

    Thanks for keeping the routine up to date.

    I know there are many here who appreciate it.

    Regards, Charles Shade             Win8 FAQ
    CSHADEDESIGN|AUTOCAD LT|LT-KB|DYNAMIC BLOCKS
    Please mark Accept as Solution if your question is answered. Kudos gladly accepted.
    Please use plain text.
    Distinguished Contributor
    ojuris
    Posts: 140
    Registered: ‎06-08-2010

    Re: You gotta try visibility-add-eng-v1.1

    11-29-2011 05:51 AM in reply to: NikolayPoleshchuk

    Thanks for the lisp!

     

    There are problems for me:

    1. I can not run command  (Move-to-visibilityset) - Autocad write  (Command: ; error: bad argument type: VLA-OBJECT nil)
    2. I can not delete elements from current visibility set -  (element-sel-current-del)

    Juris

    Please use plain text.
    Distinguished Contributor
    Posts: 152
    Registered: ‎01-08-2010

    Re: You gotta try visibility-add-eng-v1.1

    11-29-2011 11:45 AM in reply to: ojuris

    Why not copy (ctrl + c/ ctrl + v) the object into the new visibility set?

    _____

    Reid B.
    _____
    Acad 2007
    ADT 2004
    Please use plain text.
    Active Contributor
    clindner
    Posts: 30
    Registered: ‎09-24-2003

    Re: You gotta try visibility-add-eng-v1.1

    01-23-2012 01:45 PM in reply to: REID7800

    I tried v1.5 but haven't had any luck. (using vanilla 2012)

    I get this:

    Select point for placing Visibility Set:
    > (It places a "Fantom" visibility state which appears for a second, then diappears.)

    ** Visibility parameter already exists in block definition. **Unknown command 
    "L". Press F1 for help.
    Unknown command "VISIBILITY: 7FFFF0D3". Press F1 for help.

     


    The error code varies. I've seen 7FFFF0AB, 7FFFF08F, etc.

     

    Thoughts?

    Chris Lindner
    CAD Manager
    Shremshock: Architects & Engineers
    Please use plain text.
    Active Contributor
    clindner
    Posts: 30
    Registered: ‎09-24-2003

    Re: You gotta try visibility-add-eng-v1.1

    01-24-2012 11:23 AM in reply to: clindner

    Here's more info, fwiw. 

     

    I launched AutoCAD with it's <<Unnamed profile>>, to prevent any conflicts with startup code of mine. Here is the visibility_add code as it was executed:

     

     

    Command: (visibility_add)
    Select point for placing Visibility Set: _.point
    Current point modes:  PDMODE=3  PDSIZE=0'-0"
    Specify a point: 0,0,0
    Command: _.BSAVE
    Command: _.BParameter
    Enter parameter type 
    [Alignment/Base/pOint/Linear/Polar/Xy/Rotation/Flip/Visibility/looKup]: _V
    Specify parameter location or [Name/Label/Description/Palette]: _L
    Enter visibility property label <Visibility1>: Fantom
    Specify parameter location or [Name/Label/Description/Palette]:
    Enter number of grips [0/1] <1>:
    Command: _.BSAVE
    Command: _.point
    Current point modes:  PDMODE=3  PDSIZE=0'-0"
    Specify a point: 0,0,0
    Command: _.undo Current settings: Auto = On, Control = All, Combine = Yes, 
    Layer = Yes
    Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] 
    <1>: 5 (Lisp Expression) GROUP (Lisp Expression) GROUP (Lisp Expression) GROUP 
    (Lisp Expression) GROUP (Lisp Expression) GROUP Regenerating model.
    
    Command: _.BSAVE
    Command: _.point
    Current point modes:  PDMODE=3  PDSIZE=0'-0"
    Specify a point: 0,0,0
    Command: _.BSAVE
    Command: _.undo Current settings: Auto = On, Control = All, Combine = Yes, 
    Layer = Yes
    Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back] 
    <1>: 1 (Lisp Expression) GROUP Regenerating model.
    
    Command: _.BParameter
    Enter parameter type 
    [Alignment/Base/pOint/Linear/Polar/Xy/Rotation/Flip/Visibility/looKup]: _V
    ** Visibility parameter already exists in block definition. **
    Command: _L Unknown command "L".  Press F1 for help.
    
    Command: Visibility: 7ffffb23 Unknown command "VISIBILITY: 7FFFFB23".  Press F1 
    for help.
    
    Command:
    Command: -BEDIT Enter option [Save/Discard changes] <Save>: _.point
    Invalid option keyword.
    Enter option [Save/Discard changes] <Save>: 0,0,0
    Invalid option keyword.
    ; error: bad argument type: lentityp nil
    Enter option [Save/Discard changes] <Save>:

    After this, there is a single visibility state in the drawing, as indicated by the "VisibilityState0" shown on the Visibility pane. However, there is no actual Visibility Parameter in the editor (according to Quick Select).

     

    Also, I have tried this by inserting the block into an empty drawing, and by opening the source DWG file (attached) directly (which goes into the Block Editor).

     

    Hope that helps.

     

    Thanks!

     

    Chris Lindner
    CAD Manager
    Shremshock: Architects & Engineers
    Please use plain text.
    Contributor
    Posts: 19
    Registered: ‎08-01-2012

    Re: You gotta try visibility-add-eng-v1.1

    08-01-2012 12:51 AM in reply to: *T Bennett

    I am getting almost exactly the same error as the post above. I've highlighted where it differs in Red (just in case it helps) and Green is what I entered.

    Has there been any further progress on this?

     

    I'm running acad 2012, I'm using the latest v1.5, it's a wblock (not a block within a dwg), and there were no pre-existing view states.

     

    I've attached the file I am tralling this on.


    Command: (visibility_add)
    Select point for placing Visibility Set: 7,0,0
    _.point
    Current point modes:  PDMODE=34  PDSIZE=6.000
    Specify a point: 0,0,0
    Command: _.BSAVE
    Command: _.BParameter
    Enter parameter type
    [Alignment/Base/pOint/Linear/Polar/Xy/Rotation/Flip/Visibility/looKup]: _V
    Specify parameter location or [Name/Label/Description/Palette]: _L
    Enter visibility property label <Visibility1>: Fantom
    Specify parameter location or [Name/Label/Description/Palette]:
    Enter number of grips [0/1] <1>:
    Command: _.BSAVE
    Command: _.point
    Current point modes:  PDMODE=34  PDSIZE=6.000
    Specify a point: 0,0,0
    Command: _.undo Current settings: Auto = On, Control = All, Combine = Yes,
    Layer = Yes
    Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back]
    <1>: 5 (Lisp Expression) GROUP (Lisp Expression) GROUP (Lisp Expression) GROUP
    (Lisp Expression) GROUP (Lisp Expression) GROUP Regenerating model.

    Command:
    Command: _.BSAVE
    Command: _.point
    Current point modes:  PDMODE=34  PDSIZE=6.000
    Specify a point: 0,0,0
    Command: _.BSAVE
    Command: _.undo Current settings: Auto = On, Control = All, Combine = Yes,
    Layer = Yes
    Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back]
    <1>: 1 (Lisp Expression) GROUP Regenerating model.

    Command:
    Command: _.BParameter
    Enter parameter type
    [Alignment/Base/pOint/Linear/Polar/Xy/Rotation/Flip/Visibility/looKup]: _V
    ** Visibility parameter already exists in block definition. **
    Command: _L Unknown command "L".  Press F1 for help.

    Command: Visibility: 7ffff93c Unknown command "VISIBILITY: 7FFFF93C".  Press F1
    for help.

    Command:
    Command: BSAVE
    Command: _.point
    Current point modes:  PDMODE=34  PDSIZE=6.000
    Specify a point: 0,0,0
    Command: _.point
    Current point modes:  PDMODE=34  PDSIZE=6.000
    Specify a point: 0,0,0
    Command: nil

    Please use plain text.
    Distinguished Contributor
    rapidcad
    Posts: 132
    Registered: ‎05-24-2011

    Re: You gotta try visibility-add-eng-v1.1

    08-01-2012 06:30 AM in reply to: johnfraser

    I wouldn't have a clue - Andre's lisp is way beyond me. However, I have been continuing on with multiple visibility blocks by using the 2011 version of the program (v1.3, 24.10.09) in AutoCAD 2011. I can then go ahead and use the finished blocks in AutoCAD 2012-2013 without issues. I have written a little epilogue to the program in order to simplify calling the functions. It is a lot easier to do something like this so that you are not encumbered with entering autolisp lines at the command prompt. I keep a printout of this next to my workstation so I can refer to what the commands do - it simplifies using the program sugnificantly.

     

    ;;;turn functions into commands with simple calls
    (defun c:EGO () (eval_graf_output));get ACAD_EVALUATION_GRAPH dictionary from the block editor space
    (defun c:VA () (visibility_add));add a new Visibility Set parameter
    (defun c:VU () (visibility-up));set selected Visibility Set as current
    (defun c:NCVS () (tecuch_visibility));find name of current visibility state
    (defun c:GON () (eddedd));switch on grips of all the elements of the current Visibility Set
    (defun c:RFV () (element-sel-current-del));remove selected elements from the current Visibility Set
    (defun c:RAFV () (element-all-current-del));remove all elements from the current Visibility Set
    (defun c:AVS () (element-sel-current-insert));add selected elements to current Visibility Set
    (defun c:VC () (Visibility_clear));complete cleaning of current state from all the elements, dynamic properties and states
    (defun c:'SVAA () (properties_add_all_visibility));set visibility of all the dynamic properties and grips in all the states of all Visibility Sets
    (defun c:BSVS () (move-to-visibilityset));batch set visibility of selected entities in several chosen states of the current visibility set

    [note: Remove ' from before SVAA command defun - the discussion group sees the colon and capitol S as code to add a smiley!]

     

    I'll include the instructions (copied and edited for my changes), as well as the tips that I've learned after using this for a year now to create hundreds of Multipe Visibility Dynamic Blocks.

    ------------------------------------------------------------------------------------------------------

    Elements:
    Lines, arcs, splines, attributes, text, etc.

    1) Place all the elements. The location doesn't matter at first, so make them easy to select by not stacking things on top of each other.

    2) Add all the parameters/actions you want - DO NOT add any visibility states or lookups yet. Make sure your actions affect the things you want, and don't affect the things you don't want them to.

    3) Load visibility-add-eng.lsp.

    4) Add a visibility parameter using VA(visibility_add). Rename the parameter accordingly.

    5) Set this new visibility parameter active using VU(visibility-up). There is a little problem with the program here. When you have one visibility parameter active and you set a new one active, it gets hung up. Use the visibility state pulldown and select a state. Note the command line will ask you for a visibility state. Type ? to see those available, then type in any name you want.

    6) Add the states to the list of visibilities - DO NOT change the visibility of anything yet.

    7) Using RFV(element-sel-current-del) select all the elements you do not want to be affected when you change this particular visibility state. I do this by typing RFV, then entering ALL for the selection set, then removing my choice entities from the ALL selection set so only my choice entities get into the visibility set. For example: If I'm working on the "actuator" visibility states, I don't want my valve type to change if a person wants to use a different actuator, therefore, I will select every element that is not an actuator.

    8) Now you can make elements visible or invisible in the states you've defined. Do not bother changing the visibility of the elements you've removed.
    NOTE: if you draw a new object or copy something, it will not be removed
    from any visibility sets.

    9) Repeat steps 4 thru 8.

     

    TIPS:

    You can add new entities to an existing MVDB (multiple visibility dynamic block) by inserting, copy pasting or drawing them, then using SVAA to include them in the visibility sets. I find that this seems to add the new entities to every visibility set, so I have to make each one active (VU) and make unneeded entities invisible, or RVF them.

     

    If after you add an additional visual parameter, you have trouble setting it current, just test the block and close the test window. VU will now accept it as the current state.

     

    I can get a misbehaving block to recover sometimes by testing it in the test window, renaming it there with the rename command, copy-pasting it out and pasting it into a new drawing where I can open it in the block editor, reload the visibility engine and it will often work again.

     

    Although we are not supposed to be able to, I can add a block table (block properties table) and still get multiple view parameters to work.  The trick is to add the table and not populate it with anything but one simple parameter – something like a linear move, just to get the grip to show up. Then once you have the block functioning correctly with every other parameter, test the block, rename it as a “build mule” (a good copy that you can fall back and restart on) in the test window, copy that mule out to a safe drawing, then go back to the block in the editor and populate the table with all the parameters you need. MVDB’s cannot tolerate user parameters (the kind that block property tables allow you to add ), so once you add some, you will not be able to do further editing  unless you open that block property table, delete the user parameters you made, wipe out the data in the table (I copy-paste my data to an excel spreadsheet for safekeeping, and paste it back in once I have the columns redefined properly), then close the block property table and use the parameter manager to delete the user parameters. Now you can edit the MVDB further and when you are ready, add the user parameters and data (from excel) back in and test. Once a block table is populated, the block will cease to function properly if further editing occurs, but further editing can be accomplished with the workaround.

     

    I always use the test window and then rename my MVDB and then copy-paste out to my master drawing (called my dynamic block gene pool). The gene pool contains every MVDB I have in various stages of working iteration until completion. I have found this to be the best way to back up since using this lisp a lot can cause crashes when you try new ideas sometimes. I crash it 3 or 4 times a week, sometimes in a problem block, I might crash AutoCAD 10 times that day. But that’s how I learned enough to write these tips.


    Hope this helps contuous use of this very helpful program.

    Ron

     

     

    Ronald A. Powell
    CAD Developer/Operator
    TGW Systems Inc.
    Spring Lake, MI
    Please use plain text.
    Contributor
    Posts: 19
    Registered: ‎08-01-2012

    Re: You gotta try visibility-add-eng-v1.1

    08-01-2012 06:59 AM in reply to: rapidcad

    Could I ask a favour.

    Could you try it with the block I attached.

    Just to make sure it isn't something with my set up. If it doesn't work for you I'll try fom scratch again... if it does.. I guess I'll wait till 1.6.

     

    My intention was to have different vis states for each of the different letter pairs and attribute pair (3.5, white). An on/off for the breakline; and a show left, or show right or hide both for the number ref (2.5 green along with 255 and red line).    :smileywink:

     

    Then of course fix the rotation so it doesn't mess (why is the rotate such a ball ache) up the breakline stretch, yada yada yada... it's just a test block, please bear that in mind.

     


    I included the pre and post property table inclusion blocks.

    I get the same error on both.

    Please use plain text.