Jump to content

Draw order routine? for Blocks


Recommended Posts

When I draw blocks I do a wipeout command on a lot of them, which basically makes it look like something has been trimmed but it is actually hidden behind the block.

 

for example I insert a block ( a box ). then I draw a line right through it and it hides the line behind it so it looks like it has been trimmed.

 

 

anyways, I want to assign a certain draw order to blocks. Say I have a 90, that I want to cover the pipe, yet the coupling to cover the 90. That way I can draw stuff fast, then at the end hit a button and it shifts everything in a certain draw order.

 

the send to back and bring to front assigned to certain blocks in a routine. I know it's possible

Link to comment
Share on other sites

^ Yes, basically you want to filter those blocks out and apply draworder to them.

 

Here's how you would filter them via LISP, assuming the name of the 90 is "Elbow-90"

 

(setq All90s (ssget "x" '((0 . "INSERT") (2 . "Elbow-90"))))
(command "draworder" All90s "" "f")

Link to comment
Share on other sites

^ Yes, basically you want to filter those blocks out and apply draworder to them.

 

Here's how you would filter them via LISP, assuming the name of the 90 is "Elbow-90"

 

(setq All90s (ssget "x" '((0 . "INSERT") (2 . "Elbow-90"))))
(command "draworder" All90s "" "f")

 

 

now where would I put this, would I run it like a reactor? or would I put this code in the lisp for that certain block on the toolbar.

 

 

say I want the coupling to be on top, the elbow to be 1 below that, and the line to be under both of them.

 

how would that look? just like what you have there? I will try this out before any other questioning, you have been a great help man, thanks.

Link to comment
Share on other sites

now where would I put this, would I run it like a reactor? or would I put this code in the lisp for that certain block on the toolbar.

 

say I want the coupling to be on top, the elbow to be 1 below that, and the line to be under both of them.

 

how would that look? just like what you have there? I will try this out before any other questioning, you have been a great help man, thanks.

 

I might be late, but they way I would do it is to save the function as a lisp file, and have a command line/button macro to call it.

 

Here's what you would save in a *.lsp file (assumes the coupling block name is "Cplng-1"):

 

(defun c:Block2F ()
(setq All90s (ssget "x" '((0 . "INSERT") (2 . "Elbow-90"))))
(command "draworder" All90s "" "f"); bring elbows to front
(setq All90s (ssget "x" '((0 . "INSERT") (2 . ""Cplng-1""))))
(command "draworder" All90s "" "f"); bring couplings to front
(princ)
)

Then for your menu macro, have:

 

^C^CBlock2F

Hope that works.

Link to comment
Share on other sites

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