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

Multiple Visibility Lisp routine

34 REPLIES 34
SOLVED
Reply
Message 1 of 35
Charles_Shade
10563 Views, 34 Replies

Multiple Visibility Lisp routine

Could the users of this Lisp post the several Versions here for others to find?

I have come across a few in the AUGI Dynamic Block Forum who would like to make use of the Lisp but may be running into Version problems.

(And I thought that using the subject line would help.)

 

Link to visibility-add-eng discussion thread:

Original Thread

 

34 REPLIES 34
Message 2 of 35

Message 3 of 35

Of course it is possible to check AutoCAD version before selecting an appropriate branch of user program.

But I hope that visibility-add-eng-v1.5 should work in versions 2007-2012.

As you know link for v1.5 is as follows: http://www.private.peterlink.ru/poleshchuk/cad/Download/visibility-add-eng-v1.5.zip

There is no enough statistics of using it.

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Message 4 of 35

Message 5 of 35
VMAnv
in reply to: Charles_Shade

 

Hello,

 

I have a problems with the lisp...I can't get it to work. ( I downloaded the lisp "visibility-add-eng-v1.5" )

 

First off all I needed to change the lisp. 

 

I placed "c:" before defun c:visibility_add and defun c:visibility_add.

Under this condition i can get to the commands in the command line after loading the app in autocad. 

 

Real problem:

 

After the command visibility_add and selection the point for the visibility set, autocad place a "fantom" visibility state which appears for a second and then diappears...

 

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.

 

What can be the solution for this problem?

 

THANKS!

 

Commandline history:

 

Command: VISIBILITY_ADD Select point for placing Visibility Set: _.point
Current point modes:  PDMODE=0  PDSIZE=0.00
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=0  PDSIZE=0.00
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 VISIBILITY_ADD GROUP Regenerating model.

Command: _.BSAVE
Command: _.point
Current point modes:  PDMODE=0  PDSIZE=0.00
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: 7ffff615 Unknown command "VISIBILITY: 7FFFF615".  Press F1
for help.

Command:
Command: VISIBILITY_ADD Unknown command "VISIBILITY_ADD".  Press F1 for help.

Command: _.point
Current point modes:  PDMODE=0  PDSIZE=0.00
Specify a point: 0,0,0
Command: _.point
Current point modes:  PDMODE=0  PDSIZE=0.00
Specify a point: 0,0,0
Command: nil

Command: _.BSAVE

 

 

Message 6 of 35
mj.harris
in reply to: Charles_Shade

I'm having the same problem too........

 

Command: (visibility_add)
Select point for placing Visibility Set: _.point
Current point modes:  PDMODE=0  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=0  PDSIZE=0'-0"
Specify a point: 0,0,0
Command: _.undo Current settings: Auto = On, Control = All, Combine = No, Layer
= Yes
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back]
<1>: 5 (Lisp Expression) GROUP (Lisp Expression) GROUP Regenerating model.
(Lisp Expression) GROUP (Lisp Expression) GROUP (Lisp Expression) GROUP Load
Application... Regenerating model.

Command: _.BSAVE
Command: _.point
Current point modes:  PDMODE=0  PDSIZE=0'-0"
Specify a point: 0,0,0
Command: ; error: bad association list: (nil nil nil nil nil nil nil nil)

Message 7 of 35
DBdJ1
in reply to: mj.harris

The lisp seems to work in AutoCAD 2016, 64 bits, but when saving the block and returning to Modelspace or Paperspace, only the active Visibility State is found. At least, when using a lookup.

Message 8 of 35
Charles_Shade
in reply to: DBdJ1

The originator of this Lisp stopped editing it several versions of CAD ago. I remember that AutoCAD 2010(?) was about the last version it worked in properly. It is unlikely that the author will return to it. Maybe someone else will take up the mantle and make sure the coding works with current versions of AutoCAD.

Message 9 of 35
DBdJ1
in reply to: Charles_Shade

The blocks created with that old versions is still usable in AutoCAD 2016, it sees all Visibility States Parameter (VSP). Not editable by the Block Editor in AutoCAD 2016: deleting some parameters and it is a normal block. I downloaded an old block from the OOTB VS thread:

https://forums.autodesk.com/t5/dynamic-blocks/ootb-multiple-visibility-states-solution/td-p/4961288

 

The lisp is also working in the block editor of AutoCAD 2016 (on a new block), only the last set VSP works in Modelspace. I can still add another VSP and set and add Visibility States after renaming the name: that HEX code isn't accepted.

So the coding still works, maybe just changing some DXF code so the Modelspace/Paperspace sees more VSP.

 

In the Lisp-file I added two command to use it more easily.

Message 10 of 35
DBdJ1
in reply to: DBdJ1

Good news: the visibility-add-eng.lsp is still working under AutoCAD 2016! At least for two Visibility States Parameters added by the Lisp.

I wrote a manual and created command in this lisp, upgraded it to version 1.6. The commands and manual is printed on the command line when the lisp is loaded.

Cross posted in the OOTB Visibility States.

Message 11 of 35
NikolayPoleshchuk
in reply to: DBdJ1

DbdJ1, thank you for good news!

I have added information to the page on Mysteries of Autodesk's Caves.

Nikolay Poleshchuk
http://poleshchuk.spb.ru/cad/eng.html
Message 12 of 35
DBdJ1
in reply to: NikolayPoleshchuk

I saw the Multiple combo Lookup wasn't needed, so that saves a lot of time.

I will replace the files in this post, I can't edit the previous one anymore.

 

 

Message 13 of 35
Libbya
in reply to: DBdJ1

Thanks for your efforts.  I'm on 2015 and it will add visibility parameters, but the visibility parameters are not independent.  I could not get it to work on the simplest of blocks.

Message 14 of 35
DBdJ1
in reply to: Libbya

I added the visibility parameters and a three tables lookup as last and then refilled the tables of the first two lookups and did no other actions, no other sequences tested yet.

I took my originally block that I already had created, deleted the visibility states. My old lookups were based on points, this didn't work with the newly added parameters by the lisp.

 

I did test the other commands as well, so I don't know if that is the difference? I didn't use them in the second created one or It went wrong.

 

Changing a state belonging to the first one added, made me renew my second one: repasted entities, deleted and recreated states.

 

Combo lookup with 2 tables added in the orginally version and filled the old way then created and filled (description in the first posted 1.6 version lisp) a three tables lookup after I added the visibility parameters and came to the conclusion it was working without.

 

I noticed the Lookup to Excel lisp didn't work on this block, on a new block it did. Other kind of lookups,other parameters?

 

I use plain AutoCAD 2016 (no SP1) and Windows 7 64 bits. Just reinstalled it and added VBA support, Visual Studio 2012 and Office 2007.

Message 15 of 35
Libbya
in reply to: DBdJ1

I don't understand what you are saying about the lookups.  The original vis-add-eng made it so you did not need to add any lookup tables at all in order to make the idependent visibility changes.  The functionality of the current version of the lisp does not seem to allow you to separate the objects that are affected by the different visibility states.  It seems to me that the way it is currently working is just a more complicated version of the lookup multi-vis.  I look forward to being wrong about this.  See the attached screencast.  When selecting a new visibility state it turns on all of the objects that should be controlled by another visibility parameter despite running the vspdelsel, vspdelall, vspclean, etc...

 

 

The issue seems to be that the commands that isolate the visibility parameter objects are not working.  At minimum you need the commands 'vspaddsel' and 'vspdelsel' working in order for it to be functional.

 

I appreciate your work on this and offer congratulations on what you have done so far.  I hope you continue and make it fully functional.

Message 16 of 35
DBdJ1
in reply to: Libbya

I tested this before I used the lookup. I notiiced I needed Lookups to change states.

For me the states weren't changed when I selected another Visibility State option/parameter, somehow it remembers the state of the Lookups combined (added by AutoDesk, so it works at every version) and not the states of the visibility parameters combined.

It then looks like every Lookup is combined with a different Visibilty State Parameter (VSP), just because it remembers the value of the lookup.

And lookups give you more flexibilty to separate things and give it a user friendly name. Especially when the names must be UNIQUE! ! !

 

Unique values in Lookups:

I tested it with points in a Lookup too: it must be unique! Even adding the Y values wasn't enough. X for the lookup action (same values), Y for the Lookup sequence (0 = Lookup A, 1 = Lookup B, etc.)

So I used the VSP-values in the Lookups.

 

New test-method to separate the Visibilty State Parameter(s) (VSP) and make it easier

When this works, it is OOP (Object Oriented Programming) just build modules of blocks (then you can use other parameters as well to do the same):

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

I'm going to test with dynamic subblocks in a dynamic head block: the visiblity parameter stores handles for every state, so it should work to show/hide objects: every Lookup his own block and Visibilty State Parameter (VSP). Handles are unique and don't change while in the same drawing.

I need to (tested before with my Excel-file to add states and lookups to the right object):

  - Add a VSP in the  headblock, rename it to the VSP_Blockname_Head (always needed).

  - Add  a Lookup with the VSP_Blockname_Head values (always needed)

 

  Option 1:

  - Add VSP in the subblock and make the states. Rename to VSP_Blockname_Sub

  -  Hide other object off in the Default State.

  - DXFout and edit it with Word, Wordpad, Notepad.

  - Search for VSP_Blockname_Sub.

  - Remember the value of key 91 (amount of Visibility State): next line.

. - Copy the section to my clipboard with 303 keys and values. Next key is 304.

  - Seardh for the VSP_Blockname_Head name

 -  Change the value of key 91 to the one of the VSP_Blockname_Sub: next line

 -  Select the 303 key and value, just before reaching key 304.

       -  Paste from my clipboard and hide the other objects in the Head Block later.

       - Combine the values Standard State of VSP_Blockname_Head  and VSP_Blockname_Sub

 - Save the DXF as plain text and open with AutoCAD.

 

 - Option 2: Create a function in Lisp/VBA/.Net to synchronise the VSPs. between the Sub and Head block.

 - Option 3: Being able to select subentities in the subblock, while in the blockeditor before using BVShow/BVHide.

 - Option 4: Or using Refedit to move objects from one block to another.

 

 

Message 17 of 35
DBdJ1
in reply to: DBdJ1

Option 1 and 4 didn't work. Option 4 makes a new not dynamic block, it seems.

Message 18 of 35
DBdJ1
in reply to: DBdJ1

Now I know how to do it, created another command and manual updated too:

- Place eventually objects you want to see in all Visibility Parameters, you will see them in each state.

- Make all Visibility Parameters you need and one extra.

- Rename them.

 

- Per parameter:

  - Set the parameter active.

  - Place objects.

  - Make eventually Visibility States.

- Before saving the block and returning to Modelspace: select the extra created parameter, because AutoCAD refreshes the handles when reopening the drawing or Block Editor, so on that Visibility Parameter are all objects on.

- Just select the right Parameter in Modelspace and it is changed right away. Not tested the properties window.

 

I made an almost perfect block with 20 Visibility States, filled 5 and one Save State. There is only one mistake: I selected the help line in all Off states, but it isn't shown if all states are set to Off.

No Lookups needed, unless you want it of course.

Message 19 of 35
DBdJ1
in reply to: DBdJ1

 That problem solved too by adding a lookup with an initial (startup) value and adding the Save Status VSP as initial value.

 

Now we know that the enitities are perfectly separated we can repair the VSPaddSel and VSPDelSel too, just by adding/deleting the right handles at the right Visibility Parameter.

Message 20 of 35
vavalexus
in reply to: DBdJ1

Is there a lsp for AutoCad 2012? I've come throught all versions of this lsp, none works in AutoCad 2012, it just cannot clear visibility set off elements (made in 2010). And it cannot insert second visibility. AutoCad 2010 works as a charm. 

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

Post to forums  

”Boost

 

”Tips

 

”Services