Jump to content

Recommended Posts

Posted

Change this line, perhaps?

 

(defun c:Invis ( / tmp )
 ;; Lee Mac  ~  27.04.10

 [color=seagreen];; (if (setq tmp (ssget "_:L"))[/color]
 [color=red](if (setq tmp (ssget "_x" '((10 0 0 0))))[/color]

   ( (lambda ( i / e )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (Update
           (PutDXF 60 1 (entget e))
         )
       )
     )
     -1
   )
 )

 (princ)
)

  • Replies 30
  • Created
  • Last Reply

Top Posters In This Topic

  • antistar

    10

  • BlackBox

    9

  • Lee Mac

    7

  • rkmcswain

    2

Top Posters In This Topic

Posted

Earlier (apparently even as new as 2009) versions don't like the 60 code (60 . 0) of visibility being appended to a visible object. Just have it check if the code exists and then update, otherwise, just ignore.

 

eg.

(if (assoc 60 ....

Posted
Earlier (apparently even as new as 2009) versions don't like the 60 code (60 . 0) of visibility being appended to a visible object. Just have it check if the code exists and then update, otherwise, just ignore.

 

eg.

(if (assoc 60 ....

 

Oo! Didn't know that - thanks Alan :thumbsup:

Posted
Change this line, perhaps?

 

(defun c:Invis ( / tmp )
;; Lee Mac ~ 27.04.10

[color=seagreen];; (if (setq tmp (ssget "_:L"))[/color]
[color=red](if (setq tmp (ssget "_x" '((10 0 0 0))))[/color]

( (lambda ( i / e )
(while (setq e (ssname tmp (setq i (1+ i))))
(Update
(PutDXF 60 1 (entget e))
)
)
)
-1
)
)

(princ)
)

 

 

Is not working...:(

Posted

Updated for completeness:

 

(defun c:AllVis ( / tmp )
 ;; © Lee Mac 2010
 
 (if (setq tmp (ssget "_X"))
   
   ( (lambda ( i / e l )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (if (assoc 60 (setq l (entget e)))
           (entupd
             (cdr
               (assoc -1
                 (entmod
                   (subst (cons 60 0) (assoc 60 l) l)
                 )
               )
             )
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

(defun c:Invis ( / tmp )
 ;; © Lee Mac 2010

 (if (setq tmp (ssget "_:L"))

   ( (lambda ( i / e l )
       (while (setq e (ssname tmp (setq i (1+ i))))
         (entupd
           (cdr
             (assoc -1
               (entmod
                 (if (assoc 60 (setq l (entget e)))
                   (subst (cons 60 1) (assoc 60 l) l)
                   (append l (list (cons 60 1)))
                 )
               )
             )
           )
         )
       )
     )
     -1
   )
 )

 (princ)
)

Posted
Updated for completeness:

 

....What happens if the user were to define/undefine subsequent selection sets between the Invis, and AllVis commands? :unsure:

 

[edit]

This would not pose a problem, as AllVis steps through all items in the drawing's database, correct?

[/edit]

Posted
Oo! Didn't know that - thanks Alan :thumbsup:
:) You're welcome.

 

....What happens if the user were to define/undefine subsequent selection sets between the Invis, and AllVis commands? :unsure:

 

[edit]

This would not pose a problem, as AllVis steps through all items in the drawing's database, correct?

[/edit]

Correct.

Posted
There are several problems with this, but to identify a few:

(setq ss (ssget "_C" '(0 0) '(0 0))) ; <- Nothing is selected (nil)

 

Not necessarily true. Anything that lies on 0,0 will be selected with this (ssget) statement.

For example, a line from -1,-1 to 1,1, or a point at 0,0, etc.

Posted

Lee, McSwain, Alan and RenderMan,

 

His tips were very helpful.

Thank you very much.

Posted
Not necessarily true. Anything that lies on 0,0 will be selected with this (ssget) statement.

For example, a line from -1,-1 to 1,1, or a point at 0,0, etc.

 

RK, you're absolutley right :oops: ... Thanks for the clarification.

  • 5 years later...
Posted

Lee,

 

Nice piece of code as always!

 

I am trying to figure out if I can slightly modify this though to suit my needs. I need to select objects within an xref instead of the main model. Whenever I have tried writing my own version of this in the past, the visibility setting of each object was actually being save inside the xref file. The only way I could make the objects visible again was to open the xref file and run the second part of my code. Is there a way to control the visibility of xref objects within the file that has the attached xref instead of within the xref file itself? I tried changing your (ssget "_X") to (ssget "_:N") but that did not work.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...