Jump to content

Change visible of block before inserting?


Recommended Posts

Posted (edited)

I have a Fastener block that has a side and top visibility.  I want to insert the block with a side or top view by using a drop-down menu.  The default view is side so that's not an issue.  To insert it as a top view I'm using Lee-Mac's dynamic visibility function to set the visibility.   I am able to get his lisps working but I have a visual problem.

 

When I insert the block as a Top View the block comes in as a side view, then I run Lee-Mac's subroutine to set the Top View.  I'd like the Top View to be visible when I drop it in the drawing. 

 

I thought about one possible workaround.

  1. I could insert the block and "0,0,0"
  2. Run Lee-Mac's subroutine to set the visibility.
  3. Then move the block with base point "0,0,0" and pause for user input. 

The only visual problem with this is that I see the "Rubberband" line when "inserting" the block.   I haven't found how to turn off the rubber band.  Also, if the user cancels the insert the block will remain at (0,0,0).

 

I could post my code but It's so very specific to our office that it wouldn't run on your pc.

Edited by guitarguy1685
Posted

found another (haven't tried it) but its about the same problem

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/insert-dynamic-block-with-visibility-state-pre-selected/td-p/4713881

 

  • Like 1
Posted

thanks a bunch Lee Mac! This is exactly what I was looking for.  

 

not sure if I'm doing something wrong, but when I use that lisp to insert a block whose "Block Unit" is in millimeters, it sets the block scale to 25.4.  

 

I can't see why it would do that since your code sets the scale to 1.0

 

(vl-cmdf "_.-insert" blk "_S" 1.0 "_R" 0.0 "\\")

What would case this behavior?

 

Works for all blocks whose "Block Unit" is inches thought. That works like a charm.

Posted (edited)

*Edit*

 

Okay so this is weird. I can't tell if it's the LISP or my blocks.  Check these two blocks I have.

 

When I use the LISP the RB22 block inserts Scaled at 25.4, but the KK block inserts fine.

 

If I use a simple insert command for the RB22 it inserts fine. It only scales up when I use the lisp. Scratching my head.

 

KK_End_C3.dwg

RB22-16_DYN.dwg

Edited by guitarguy1685

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