Visibility before command

Visibility before command

john.uhden
Mentor Mentor
774 Views
15 Replies
Message 1 of 16

Visibility before command

john.uhden
Mentor
Mentor

Other than by using entmake, is there a way to make an object created by a command invisible before it's being created?

I am playing with my COIL command for the passive pool heater and making the coil by the PLINE command.  But then I must iterate the command, changing input values, until it is the right size.  That means I have to vla-delete it and build it again each iteration.  It looks annoying and unprofessional.

I guess I could change my approach to using entmake but I think the code would be tedious.

John F. Uhden

0 Likes
Accepted solutions (2)
775 Views
15 Replies
Replies (15)
Message 2 of 16

john.uhden
Mentor
Mentor
Accepted solution

Nevermind.  I got it.

(command "_.layer" "_M" "COIL" "_OFF" "COIL" "_Y" "")

afterwards turn it back ON.

John F. Uhden

Message 3 of 16

hak_vz
Advisor
Advisor
(vlax-put-property OBJ 'visible 0); off
(vlax-put-property OBJ 'visible 1); on

or using vanilla autolisp

(setq ent (subst (cons 60 0)(assoc 60 ent)ent)); on
(setq ent (subst (cons 60 1)(assoc 60 ent)ent)); off

or options using Autocad commands (isolateobjects)

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 4 of 16

Kent1Cooper
Consultant
Consultant

Can you just do the calculations for the Pline vertices, without drawing one, and if something ends up out of bounds, go back and adjust some value and do the calculations again, until you get an end result in-bounds, and only then do the drawing of the Pline?  In other words, iterate the calculations rather than the drawing of the Pline.

Kent Cooper, AIA
0 Likes
Message 5 of 16

Sea-Haven
Mentor
Mentor

Look into house INSULATION plines I am guessing your drawing a line, then a 180 arc, then a line, 180 arc and so on. Do you really need to hide, the pline command is very fast in a repeat style lisp. I have 3 wavy insulation routines and are very fast. Would need for this a left and right arc part repeated. 2 shown.

SeaHaven_0-1641101193960.png

 

 

 

 

0 Likes
Message 6 of 16

john.uhden
Mentor
Mentor
Yes, of course. Thanks, Hak, but I'm talking about creating a state of
invisibility before an object goes into creation.
If I stick with my first attempt at using the PLINE command, it's a mess
when I have to iterate modifying/redrawing it to be the correct length
while adjusting the size of the gap in the process. I don't want to
display it until it is done.
Right now I'm thinking of shifting my approach to using entmake and
computing all the bulges. Just thinking so far. That way I can include
the 60 code at its birth, and modify it all I want until it's done and then
change the 60 code.

John F. Uhden

0 Likes
Message 7 of 16

Sea-Haven
Mentor
Mentor

Have a look at this, vauguely tested cut from a bigger program draw a line say 1000 long as a guide for p1 p9

 

(setq p1 (getpoint "\nStart ") p9 (getpoint "\nEnd ") insul_ht 200.)
(setq ang1 (angle p1 p9))
(setvar 'osmode 0)
(setq N (fix (/ (distance p1 p9) 90.0)))
(setq d1 (- insul_ht 25.0))
(setq d2 25.0)
(setq d3 (- d1 25))
(setq d4 40.0)

(setq p2 (polar p1 (+ 1.5708 ang1)  d1))
(command "pLINE"  p2 "w" 0.0 0.0)

(setq m 0)
(while (< m N)
(setq p3 (polar p2 ang1 d2))
(setq p4 (polar p3 ang1 d2))
(setq p5 (polar (polar p3 ang1 20)(+ ang1 4.71239) d3))
(setq p6 (polar p5 ang1 d2 ))
(setq p7 (polar p6 ang1 d2))
(setq p8 (polar p4  ang1 d4))
; now put pts 3,4,5,6
(command "a" "ce" p3 "a" "-180" "l" p5 "a" "ce" p6 p7 "l" p8)
; parallel lines now drawn
(setq m (+ 1 m))
(setq p2 p8)
) 

(command "")   

 

0 Likes
Message 8 of 16

john.uhden
Mentor
Mentor
@Sea-Haven
Hmm. It appears that your batting doesn't appear until the completion of
the command.
Same goes for changing command to vl-cmdf.
Not that it solves my iteration issue, but what's the trick?

John F. Uhden

0 Likes
Message 9 of 16

Sea-Haven
Mentor
Mentor

Are you not giving a length and width and then do some form of repeating pattern for a pline ? Does it have to do some calcs so says you are using 85' of pipe but you need 100 ? Then yes would not draw till it is at 100, I would just use the maths adding the lengths of straights and arcs. So would have 2 defuns 1st is calc, 2nd is draw it, so in my code would look at lengths p2-p3 + arc + p4-p5 and so on. 

 

An example  6mx2m rectang, 0.6m radius 50mm gap so length = 6-2*0.6, repeat x times maybe (2-0.1) / 0.05 look at my rainbow pipes image just drawn to show how overlap would work, obviously all black pipe. This is similar to draw slab heating coils but different pattern solutions here.

 

If we take 

 

(setq N (fix (/ (distance p1 p9) 90.0)))

 

 

Say 6m long, shape is 180mm then answer is 11.88m.

 

So work out 1 full coil for 6m length 0.6m rad is 12.685 so 30m = 2.4 loops so would maybe reduce length as not very wide. 

0 Likes
Message 10 of 16

john.uhden
Mentor
Mentor
@Anonymous=Haven

My first attempt was based on trial and error, dividing one orbit into 4
quadrants with one vertex per quadrant and computing the midpoint of each
arc segment. So I start with guessing the number of vertices, drawing it
via the PLINE command, and checking its length, width, and height, and
erasing and redoing until the values were acceptable.
It's the numerous drawing-erasing-drawing that is annoying and
unprofessional.
So I started over the weekend with functions to compute all the bulges and
to entmake invisible and modify the coordinates and bulges until I get
acceptable values. Then make it visible.
Fear not, I will get it to work nicely. But I really appreciate your
concern. Now get your own done!
Notice that I will not be posting mine early because you will just copy the
code and make it blink. 😎

John F. Uhden

0 Likes
Message 11 of 16

dbroad
Mentor
Mentor

You could also build it inside a block definition and copy or reconstruct it when done..  Using a temporary off layer is a good solution though.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 12 of 16

john.uhden
Mentor
Mentor
@Anonymous
I am flattered by your appreciation.
My v1.0 used the PLINE command, which I can't hide inside a block
definition.
I think my v2.0 will entmake it invisible and modify its properties until
it's acceptable, and then make it visible. And then Alan can make it
blink. I'll bet no one has a blinking solar water heater.

John F. Uhden

0 Likes
Message 13 of 16

dbroad
Mentor
Mentor

Understood.  Entmake or vla-add-polyline should enable you to work with block definitions, if you go in that direction later.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 14 of 16

john.uhden
Mentor
Mentor
Thanks, @Anonymous.
The way I see it, if the object is invisible at birth then there's no need
to make a block. And I need only one of them.

John F. Uhden

0 Likes
Message 15 of 16

dbroad
Mentor
Mentor
Accepted solution

I wasn't suggesting that you make it a block.  I was suggesting adding a temporary block defnition as  working space.  Obviously that method wouldn't work with command calls but I thought you were looking for options.

In reality, creating a polyline could be invisible if you initially create it as either something off screen or something small. I doubt the time it takes to create the first polyline and then to hide it would even be perceptable.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 16 of 16

john.uhden
Mentor
Mentor
Good thoughts, @Anonymous.
Will consider.

John F. Uhden

0 Likes