Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

212 REPLIES 212
SOLVED
Reply
Message 1 of 213
Anonymous
21772 Views, 212 Replies

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

Ok, the instructions aren't the clearest, however, when you get the hang of
it you'll love it. Try to make my valve (attached) without using this lisp
routine, you'll spend 10X longer.


Here are the steps I figured out:
------------------------------------------------------------------------------
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 (visibility_add). Rename the parameter
accordingly.

5) Set this new visibility parameter active using (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 (element-sel-current-del) select all the elements you do not want
to be affected when you change this particular visibility state.
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.
-----------------------------------------------------------------------

I did not list all the functions in this routine. Many I don't even know
how to use yet, or why.

Todd
212 REPLIES 212
Message 41 of 213
Charles_Shade
in reply to: Thomas.l

I believe that what you seek is possible but I do not think that it can be done in the 3D environment.

 

The gauntlet is thrown...

Make me believe Juris...

Message 42 of 213
Thomas.l
in reply to: Charles_Shade

And this is exactly where the possibility of multiple visibility states came to mind. As far as I know it isn’t possible to appoint actions to 3D models but it is possible to insert 3D models. So my plan was to draw for each standard diameter (125,160;180,200,...) pipes with an adjusting length (.5,1,2,3,4,...) it would be able to chose both diameter and length.

Kind regards

Thomas 

 

Message 43 of 213
magnumz_23
in reply to: Thomas.l

Ok so I've kept this Lisp on the back burner until I have plenty of time to implement it in our blocks.  I'm having some difficulty getting it to work though.  I'm using AutoCAD 2011 and the V1.4 of this lisp program.

 

This is what it kicks back to me in the command line when I try to use (visibility-up) on a parameter I just place with (visibility_add).  Keep in mind I've tried renaming the new vis. parameter and also not renaming it.

 

Command: (visibility-up) Select required Visibility Set:
** No Visibility Parameter Present. **

 

I'm sure the "No Visibility Parameter Present" part is the problem which causes the rest of the errors that are listed following it.  Here are those as well.


Unknown command "N".  Press F1 for help.
Unknown command "W5W".  Press F1 for help.
Unknown command "H".  Press F1 for help.
"VisConnectors"
Command: _.BSAVE
Command:  .BSAVE
Command: (command "_.-BVSTATE" "_S" tecuchiy)
** No Visibility Parameter Present. **
Unknown command "S".  Press F1 for help.
nil
Command: _.BSAVE

 

Details -

This particular block is on a dwg where I keep all of the blocks I use.  I then place these blocks in other drawings using the Design Center so I can update changes to all the blocks at once.  I can right click the blocks in Design Center to open them in Block Editor, which is usually how I make changes to them.  This particular block is dynamic and has a rotation parameter/action, flip parameter/action, and a chained move parameter/action.

 

So...is there something I'm doing in my blocks, how I'm using/altering them, or just how I'm using the lisp routines?  Either way, how do I get this to work properly?

 

Any help would be appreciated. Thanks. 🙂

Message 44 of 213
yellowlilac84
in reply to: magnumz_23

I find this idea intriguing but when I used (visibility_add) it kicks back this message:

 

Command: (visibility_add)
Select point for placing Visibility Set: ; error: bad DXF group: (360)

 

What am I doing wrong?

Message 45 of 213

I work with acad 2012 and i can't get the lisp working.

It loaded succesfully but the command 'visibility_add' isn't working.

Mvg Jos

Your drawings are only as good as the symbols that complete them...
Message 46 of 213

Have you placed brackets: (visibility_add)  ?

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Message 47 of 213
johnfraser
in reply to: Charles_Shade

I was getting the same error message in C3D 2012, so I had a go in 2011 and had no such issues.

 

I have, however, gotten a little bit further along and had some other issues with the block I've attached to this post (with just 2 separate visibility parameters):

Whenever I select a visibility state from the grip on the right, it seems to reset the other visibility state. Luckily, the reverse is not true - so I can change the right hand one and then change the left hand one. But I know that I shouldn't have to do this, so it's bugging me!

Also, I have some alignment parameters that aren't showing up despite being visible in the visibility states. Help, anyone?

 

Additionally, when I insert this as a block into 2012 (it looks fine in 2011), the visibility state grips are both located on the insertion point for some reason? They still work (I can change them from the properties box), but this is very frustrating.

Message 48 of 213

Now the program visibility-add-eng is not ready for using in AutoCAD 2012 and verticals. We need some time to find the reason and to modify.

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Message 49 of 213

I figured out that last problem that I had, it was a scaling issue. But my other problem still remains - if I change one parameter it resets the other one! I know I must've done something wrong, because the other blocks on here I tried didn't do that. I'm just not sure what it was that I did wrong.

Message 50 of 213
Charles_Shade
in reply to: johnfraser

As Nikolay stated above:

THIS WILL NOT WORK IN 2012 PRODUCT LINE AT THIS TIME. (Potential fix coming.)

Message 51 of 213
johnfraser
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.

Message 52 of 213

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
Message 53 of 213

Thanks for keeping the routine up to date.

I know there are many here who appreciate it.

Message 54 of 213
ojuris
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

Message 55 of 213
REID7800
in reply to: ojuris

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

_____

Reid B.
_____
Acad 2015
Architecture 2010
Message 56 of 213
clindner
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?


Please use the Accept as Solution or Kudo buttons when appropriate

Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors

Message 57 of 213
clindner
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!

 


Please use the Accept as Solution or Kudo buttons when appropriate

Chris Lindner
CAD Technology Consultant @ onebuttoncad.com
AUGI Board of Directors

Message 58 of 213
peter_m.
in reply to: Anonymous

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

Message 59 of 213
rapidcad
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.

😎 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

 

 

ADN CAD Developer/Operator
Message 60 of 213
peter_m.
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).    😉

 

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services