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
22042 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 121 of 213
Waheed-Akhtar
in reply to: Anonymous

hi,

 

visibility-add-eng.lsp does not work either on AutoCAD 2009 or AutoCAD 2011.

I load this lisp while  I am in BLOCK EDITOR. When I invoke Command "visibility_add" it simply says -"Unknown command "VISIBILITY_ADD".

 

I have tried all the Versions ony by one.

 

Any Solution?

 

Waheed

Mississauga, CANADA

Message 122 of 213
rapidcad
in reply to: Waheed-Akhtar

He didn't set any of the functions up as commands so you would have to enter (visibility_add) from the comand line to use it. I got tired of that and wrote my own simple 2 letter interface for it. If this is your problem too, just add the following to the code after the final closing parenthesis. (Watch out for word wrap on my descriptions)..

 

;;;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

 

 

ADN CAD Developer/Operator
Message 123 of 213
Charles_Shade
in reply to: rapidcad


@rapidcad wrote:

 (Watch out for word wrap on my descriptions)..

 


(defun c:SVAA () (properties_add_all_visibility));set visibility of all the dynamic properties and grips in all the states of all Visibility Sets

 

 


...and the occasional disgruntled emoticon...

Message 124 of 213
rapidcad
in reply to: rapidcad

Those darn smilys!  the second to the last line is supposed to read

"(defun c: SVAA () (properties_add_all_visibility))" but you can take out the space after the c:

 

This forum puts in smilys for colon preceeding s

ADN CAD Developer/Operator
Message 125 of 213
Charles_Shade
in reply to: rapidcad

When I took the quote from your previous post the quoted portion in the reply window did not show the emoticon.

Message 126 of 213
rapidcad
in reply to: Charles_Shade

Are you sure? My reading of your post still has the emoticon.

Capture.JPG

ADN CAD Developer/Operator
Message 127 of 213
Charles_Shade
in reply to: rapidcad

No, it was while in the Reply window when using the Quote feature the emoticon was not there.

When I posted the snarky comment it showed up again.

 

Screenshot of the Reply window:

 

Smiley not in Quote.jpg

Message 128 of 213

Rapidcad:

http://forums.autodesk.com/t5/Autodesk-Discussion-Groups/Emoticons-in-Coding/m-p/3755949#U3755949

 

The clipboard in the Rich Text menu bar above with the C on it is the answer.

This will post Code without emoticons.

 

 

Message 129 of 213
rapidcad
in reply to: Charles_Shade

Ooooh, Now I see! Thanks Charles!  Smiley Happy

ADN CAD Developer/Operator
Message 130 of 213

I have got Solution:

 

functions are not defined to work as commands.

add C: after defun everywhere in lisp. Like...

 

(defun C:eval_graf_output.....

(defun C:visibility_add.....

(defun C:visibility-up......etc...

 

dont forget to provide space between defun and C:

 

Waheed

Mississauga CANADA

Message 131 of 213
rapidcad
in reply to: Waheed-Akhtar

You'd be creating a few more commands than you would need to if you put a C: in front of every defun, and the command names are rather long for typing in, but if you're happy with that - it should work. I prefer 2 letter commands myself. (see 9 replies previous)

 

ADN CAD Developer/Operator
Message 132 of 213
Waheed-Akhtar
in reply to: rapidcad

I dont want to make too many chagnes in lisp file. Instead I have added few lines in my ACAD.PGP file (with very short names) and it works very well.

 

Thanks your advice anyways.

 

Waheed

Mississauga CANADA

Message 133 of 213
vavalexus
in reply to: Waheed-Akhtar

I’ve recently discovered for myself this plugin and I do like it. Therefore there is a stumbling block for me. I read that when visibility sets have elements in common they will reset each other’s visibility state. Is it possible somehow to make them not reset themselves? Say I have few objects in my dinblock:

Parallelepiped 1x1 h=1

Parallelepiped 1x0.5 h=1

Parallelepiped 1x1 h=0.5

Parallelepiped 1x0.5 h=0.5

I add two visibility sets – one responsible for Z dimension (height 1, 0.5), another for XY dimensions (size 1x1, 1x0.5).

I want to choose values of visibility toggles and to get one parallelepiped. But since they reset each other it is possible to get only two parallelepipeds, either h=1/0.5 2 pcs, or 1x0.5/1x1 2 pcs.

Tried to use lookup parameter to choose particular parallelepiped but no good.

Message 134 of 213
rapidcad
in reply to: vavalexus

If you will post a block, preferably a simple example of this I will take a look and let you know what I think. However, in my experience, I find it hard to make any entity part of two or more visibility parameter sets. You might get away with it if you find a way to only set one consistently first, then perhaps set the second one later. My example here would be with say, a visibility set containing lines that form a rectangle that you turn all of them on with, then having a separate visibility parameter controlling one of the sides of it that you may turn off.

 

I always do something similar to this in every multiple visibility parameter block. I create a master visibility parameter that contains every entity first. This parameter has only two visibility states, DEFAULT and ALL ON. I set DEFAULT to show the entities that I want as normal default view, and use ALL ON to be able to turn on any entity later during editing so that I may perhaps change a color or move something, or delete things. This visibility parameter gets hidden from the user, I just have it in there for editing purposes. Once a complex block is mostly done, it can get difficult (say if you have to add a block properties table) to set a visibility current so you can edit an entity buried deep in a hidden visibility set. Anyway, many of the entities that are part of this master visibility parameter set are also part of various other visibility sets which I will expose to the user for his control. However, if I allowed users to access the master visibility parameter and they selected either of the views, any of the other visibility parameters would need to be reviewed and many would need to be reset in order to satisfy any of those smaller visibility parameter sets.

 

I hope this helps make sense of this all. Post a block if you want some more information on this.

 

Ron

ADN CAD Developer/Operator
Message 135 of 213
vavalexus
in reply to: rapidcad

Hi Ron!

 

Thank you. I will try to read into it deeply since it is a bit complicated.

 

I scattered around elemnts so far for editing purpose. The idea is, the left grip is responsible for elements height, the right one for each element's wall visibilities. Left grips works fine, left forks fine for turning walls off, but if I try tu turn it on again it gets messed up. I have already devided each element from each other into separate visibility group, so there are no parts in common in visibility set. Since I got to know that if there are common parts then visibility sets will reset each other. So I moved them apart and try to operate their visibilities through lookup parameter. But again something goes wrong.

 

The task is to assemble into single block many elements with further different parameters:

height h=0.1; 0.3; 0.5; 0.7; 1.0; 1.1
dimensions d=1x1; 1x0.5; 0.5x0.5
visibilities for walls: v= wall is visible; wall is invisible

And in this single block I need to have 3 grips: h, d, v (corresponding mentioned above parameters)

Message 136 of 213
rapidcad
in reply to: vavalexus

I'm looking at it, but I can't really dig in much today. However, I did think of something. Perhaps this block could be done with just a single left side panel that gets stretched by a few linear stretches. You could then use a typical lookup parameter to coordinate the side being on or off and properly stretched to fit. Then you wouldn't have an issue with turning on so many sides that you don't want to see.

 

What the heck, I'll stop, take a look inside and see if I can make some sense of this. Now that I have it open in the block editor, I see that you have about 6 visibility parameters for those cube shaped podiums, each consisting of off, on, and all visibility states. Is there a difference between all and on? I can't see one. It appears that the left-wall visibility states are similar, only consisting of just one wall, but having the same 3 visibility states and you have the same thing - one visibility parameter for each left-wall.

 

I'm trying to grasp your dynamic block structure. I don't think I would approach it this way, but I don't really have the time right now to think this all the way through. Here's what I can come up with at the moment: Why not try one lookup table with twice the length - 12 lines? Each podium with wall on, and wall off. That certainly would work, the attached block has this done but only for the first 1x1 size- you could continue the pattern. You might even try a block properties table to cascade this and show the six podiums in the first column and on or off in the second column.

 

Maybe I can look at this in more depth later today or tomorrow too.

 

Hope this helps!

ADN CAD Developer/Operator
Message 137 of 213
vavalexus
in reply to: rapidcad

Hi,

Do not pay attention to "all" state in previous block.

I used to have stretch + lookup. Please see the example attacehed. It is how i did it before. But the thing is, I'm migrating to Autocad 2013 and it doesn't render poylines well. It renderes it as Autocad 2006 with smoothing angle more than 90 degrees. So it gets rendered as cylinders, not as parallelepipeds. The only wayout for Autocad 2007+ is to use solids, so it renderes fine but no stretch available in din blocks for solids. So I need to combine visibilities, and can’t just figure out how to handle visibilities being resetting each other. In attached example there are also common elements – pillars in the corners. So if I turn left side off, then top side off and immediately on it will turn left top pillar on, it is evident and logical. I need to re-switch off left wall then. Just need to think how to handle it without stretch, only with visibilities.

Message 138 of 213
rapidcad
in reply to: vavalexus

So, do you want to control each wall individually like your latest block? It sounds like you want the blue pipe columns to remain on while the side panel turns off. Can you take the blue pipe columns out of the side visibility sets?

 

Your new block looks quite different in how you set the visibility parameters up. I think I like it a lot more. I would maybe consider taking the blue pipe columns out of all visibility parameters and that would force them to be on at all times. It seems like you always would need all four columns anyway.

 

I tried removing the columns from the side visibilities. Does this new block do it for you?

ADN CAD Developer/Operator
Message 139 of 213
vavalexus
in reply to: rapidcad

The last block in my post is done the way it should be, nothing to correct there. The blue pipes (I call it pillars) must vanish with walls. If I turn left wall of, nothing remains on the left - no wall, no pillars. If I then turn top wall off, then nothing to remain from left and top side - no walls no pillars. But if I then change my mind and decide to turn top wall on it will result in turning on both top pillars despite left wall is off and nothing to remain there - no left bottom and top pillars. So I have to re-switch left wall off, so it updates and turn remaining left top pillar off. I think you get the point. But try doing the same with adding one more podium of different height in the same block. Try adding another visibility which will change podium h1 to h0.5 keeping control of walls. Let’s forget about changing dimensions, lets deal only with heights and wall visibilities. You will be able to use lookup to choose podium h1 or h0.5, and even can make wall change, but as soon as you turn one on, say of podium h1, the one of podium h0.5 will appear. Check out the attachment. With the left grip you may choose from heights and sizes list, with the middle one - visibilities of left walls, with the right one - top walls. But try to click off and on, you will see the mess. Then to clear up you'll have to use the left grip again to reset the block. This is what I really want to avoid. If visibility "off" for wall wouldn't hide them completely, or say did something else, it would mess up as "on" does. Off cause it is possible to turn wall visibilities grips on and individually turn it, but imagine how many grips there will be in the drawing. I need only one visibility grip of the current lookup. If I knew how to hide them it would help. Visibility grips cannot be hidden. Maybe I should try to create a lookup for each visibility set. Lookups can be hidden. And thus in dimensions and height visibilities I will hide odd grips. I will try to do so.

Message 140 of 213
Spiritshifterus
in reply to: Anonymous

Greetings, boardmembers. It's been a while; hope everyone is well.

 

Just before Christmas, I had joined a new firm, and we run on AutoCAD 2013 (installed via Building Design Suite, which brings a whole new slew of headaches). Only now have I had the chance to get back into using AutoCAD, and so I ran tests on the Visibility-Add-Eng-v1.4 that I used to run on AutoCAD 2010. Sadly, v1.4 didn't seem to work (errors with bad DXF files when I try to add a new Visibility Parameter).

 

But, annoyingly, v1.5 doesn't completely work, either!

 

v1.5 allows me to add new visibility parameters, but the Element-Sel-Current-Del command will not operate whatsoever. How can I possibly sort out my elements between the parameters, when the main command to do so doesn't work?

 

Has anyone else had this issue? As a thought, could clipboarding the Element-Sel-Current-Del command from v1.4 into v1.5 work? Or, is there even a newer version of the LISP routine?

 

Hope someone can help, and thanks to all who try.

 

Chris Martin

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

Post to forums  

”Boost

 

”Tips

 

”Services