Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom block

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
288 Views, 7 Replies

Custom block

Hi all, I want to make a block which is visible to snap only on a special point, say pivot point.

any hint on this?

7 REPLIES 7
Message 2 of 8
_Tharwat
in reply to: Anonymous

Could you please explain more ?

Message 3 of 8
stevor
in reply to: Anonymous

Let me guess,  anishtain4, you want to point at objects, on the screen,

and have a snap indicator appear only when the cursor 

is on a certain point in an INSERT onject of a BLOCK.

 

If so, one method is to use the function 'grread to do  ssgets

of the Aperture window, every half second or every significant

cursor move, and if the subject BLOCK name is within it,

show some marker or something like the oject snap icons,

and return that point data, eithr on finding one,

or, such a find along with some accepting key entry..

 

 

S
Message 4 of 8
Anonymous
in reply to: stevor

Yes, That is what I want, There are blocks that I want a line which is representative to pipes be drawn only on the junction of them not in the middle of fans for example.

The method you said is interesting but don't you think it would has a lot of over head for big drawing?

Message 5 of 8
Lee_Mac
in reply to: Anonymous

Easiest solution would be to include point entities within your block definition (on DEFPOINTS layer), then have a short and simple LISP program to toggle your OSNAP to 8 (Node) so that you can only snap to those point entities.

 

Simple example of such a LISP program:

 

(defun c:setsnap nil
    (cond
        (   *osmode*
            (setvar 'OSMODE *osmode*)
            (setq *osmode* nil)
        )
        (   (setq *osmode* (getvar 'osmode))
            (setvar 'OSMODE 8)
        )
    )
    (princ)
)

 

You could then also call it transparently whilst within a command using 'SetSnap

Message 6 of 8
Anonymous
in reply to: Lee_Mac

Thanks Lee, that is the best solution,

 

Nice signature by the way

Message 7 of 8
Kent1Cooper
in reply to: Lee_Mac


@Lee_Mac wrote:

Easiest solution would be to include point entities within your block definition (on DEFPOINTS layer), then have a short and simple LISP program to toggle your OSNAP to 8 (Node) so that you can only snap to those point entities.

....


Or, if the Block itself doesn't contain other things with insertion points [such as Text or nested Blocks], and if there's only one such location per Block, use the desired location as the defined insertion point of the Block, and do something similar toggling Osnap with the INSert mode [64].  No added entities are needed that way, nor are there Layer concerns.  [It may not be necessary with the Points approach, either, to put them on a non-plotting Layer, depending on the Block configuration.]

Kent Cooper, AIA
Message 8 of 8
Lee_Mac
in reply to: Anonymous


anishtain4 wrote:

Thanks Lee, that is the best solution,


 

You're very welcome anishtain, I like the simple solutions Smiley Happy

 


anishtain4 wrote:

Nice signature by the way


Thanks! Smiley Happy

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

Post to forums  

Autodesk Design & Make Report

”Boost