Jump to content
kylaughlan

Count Specific Block Name and Insert Block to Coords Depending on Block Count

Recommended Posts

kylaughlan

Hi there,

 

I'm looking for a Lisp routine that can count the number of one specific nested block (it will always have the same name) within a single layout, and then automatically insert the same block (which doesn't need to be nested) to differing coordinates depending on how many of that block there already is.

 

I am having doubts to whether this would even be possible but I thought I would ask.

Seeing as nested blocks can be counted through Lisp, I figured it might be possible.

 

I've began to explore the world of Lisp and am using a few different routines currently.

They work great but I am nowhere near at a stage where I can write a detailed Lisp routine myself.

 

[using AutoCAD 2017 full version]

 

Thanks guys,

 

Kyle

Share this post


Link to post
Share on other sites
kylaughlan

Hi, thanks for the suggestion but that is not quite what I'm looking for.

Looking back at my original post I realise that I have asked the wrong question.

 

The block in question will no longer be nested. :oops:

 

So, the block will simply need to be counted from within PS. (That is, the block will be in paper space and I will also be in paper space.)

Then, a block with the same name would then be inserted into paper space at coordinates relative to the block count found.

 

For example:

 

Block count = 1, insert block at 0,0,0

Block count = 2, insert block at 0,50,0

Block count = 3, insert block at 0,100,0

...and so on.

 

Thanks

Share this post


Link to post
Share on other sites
kylaughlan

Thank you,

 

I will have a look and try to edit it to suit my needs!

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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