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

Lisp to insert specific block to each predefined object type

7 REPLIES 7
Reply
Message 1 of 8
bigcarl5000kg
387 Views, 7 Replies

Lisp to insert specific block to each predefined object type

I'm looking for a lisp that can insert an existing block on each object with predefined object type = ASTANCHOR (see the dwg in attachment) - inserting point of the existing block on inserting point of the object. I have to manually select the existing block dwg data to be inserted.

 

I appreciate any help on this.

 

Best regards and have a nice day

+++ impossible immediately and miracles within 3 days +++
+++ the only constant is the change +++ stay tuned for more +++
+++ since 03/2023 is Advance Steel in maintenance mode, no further development +++
7 REPLIES 7
Message 2 of 8
Sea-Haven
in reply to: bigcarl5000kg

This is maybe a tool palette or design center or 

 

screenshot83.png

answer, up to you.

Message 3 of 8
bigcarl5000kg
in reply to: Sea-Haven

Hi @Sea-Haven ,

 

many thanks for your response.

 

I don't think it's necessary. It is about automatic inserting one block into several places at once (on several objects of the same type at once). I do not know of any LISP that would do this without selecting the subject on which the block will be placed - I found only a few LISPs that insert blocks on manually selected object types such as line, polyline, arc, ...

 

Another problem will be whether LISP can recognize the objects, which I saved in dwg in the attachment.

 

 

+++ impossible immediately and miracles within 3 days +++
+++ the only constant is the change +++ stay tuned for more +++
+++ since 03/2023 is Advance Steel in maintenance mode, no further development +++
Message 4 of 8
devitg
in reply to: bigcarl5000kg

@bigcarl5000kg Up to now I can get the top, middle, and bottom center of such PROXY entities . And the DownLeftPOINT, and Upright point from bounding box. 

Which and where you want to insert the block reference._?

 

devitg_0-1646664301326.png

 

Message 5 of 8
bigcarl5000kg
in reply to: devitg

Hi @devitg ,

 

many thanks for your answer. The middle point of each such PROXY entity as a insertion point for the block is the best location 😉.

 

The inserted block should be selected manually from the directory (DWG file) - an block example see attachment.

 

In principle, I need to insert this block on each PROXY entity with the object type ASTANCHOR.  However, it would be great to be able to choose between all or selected PROXY entities of this type, should such a need arise.

 

Thank you in advance for your help and have a nice day.

+++ impossible immediately and miracles within 3 days +++
+++ the only constant is the change +++ stay tuned for more +++
+++ since 03/2023 is Advance Steel in maintenance mode, no further development +++
Message 6 of 8
john.uhden
in reply to: Sea-Haven

I like it, Alan.  That's the way I displayed all our details (broken down into categories) back in R12.

Plus I gave the users tools to add their own details to the library, compete with slide image.  Plus, they could search for details using wildcards and get a short list.

It's so sad that I was stabbed in the back by our IT guy because I apparently threatened his existence by knowing more than he did.  It was the best job and pay I ever had.  He survived because he was good at cooking the president's personal books.  Oh well, at least it all raised me to my current position of survey draftsman.  yay 😞

But the good news, maybe, is that I have been offered two better paying positions where I get to design again.

They each have their downsides, so we'll see where what's left of my brain leads me.

John F. Uhden

Message 7 of 8
Sea-Haven
in reply to: bigcarl5000kg

This is result for your dwg so could work out a insert point as Devitg has suggested.

 

(setq obj (vlax-ename->vla-object (car (entsel "pick object "))))
(vla-GetBoundingBox obj 'minpoint 'maxpoint)
(setq pointmin (vlax-safearray->list minpoint))
(setq pointmax (vlax-safearray->list maxpoint))

(-10.0 -10.0 0.0)
(10.0 10.0 10.0)

If inserting a bolt though its insert point would be like center of underside of head but how would we know head thickness without more info.

 

SeaHaven_0-1646820977594.png

 

It sounds like way easier have a text file with bolt name size and insert pt. Look again at my image all that stuff is hidden behind image.

 

Message 8 of 8

Hi @Sea-Haven ,

 

I normally have a lot of these existing PROXY objects (screws) with object type "ASTANCHOR". To the middle point of each such PROXY object, I need only to insert one selected DWG block from existing directory.

 

I just wanted to automate the original laborious manual insertion of such a block a bit. With 1000+ objects it is very laborious.  

+++ impossible immediately and miracles within 3 days +++
+++ the only constant is the change +++ stay tuned for more +++
+++ since 03/2023 is Advance Steel in maintenance mode, no further development +++

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report