Author Topic: Increment the block name for each instance inserted.  (Read 3115 times)

0 Members and 1 Guest are viewing this topic.

jlogan02

  • Bull Frog
  • Posts: 327
Increment the block name for each instance inserted.
« on: April 09, 2018, 06:18:19 PM »
I know AutoCAD Electrical and other programs will allow you to insert a block from a library multiple times while it increments the block name by 1 for each insert thus allowing you to control the properties of each instance separately.

Can this be done with vanilla?

I want to create a block library where a dialog box opens and prompts the user to...
Select the block
Specify what phase of construction the block is in
Review MFG info and edit an attribute as needed.
etc., etc....

User hits OK
Inserts the block as many times as needed. For every insert, the block name is incremented by 1 so that each block is a single instance.
If the block exists, insert and increment the next block based on the highest number of the blockname found in the drawing.

This is all in order to change properties of each instance of the block separate from all other instances of the block in a drawing.

J. Logan
ACAD 2015
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Increment the block name for each instance inserted.
« Reply #1 on: April 09, 2018, 10:45:12 PM »
Why not use attributes and 1 block, you can count etc the attribute can be invisible so see block only. making a new block just bloats the dwg.
A man who never made a mistake never made anything

jlogan02

  • Bull Frog
  • Posts: 327
Re: Increment the block name for each instance inserted.
« Reply #2 on: April 10, 2018, 01:08:27 PM »
Your suggestion is a good one and is definitely on the list of attributes needed. The larger issue is controlling the properties of two instances of the same block separately.

I'm looking for solution that will allow me to insert a the same symbol multiple times, and re-name each instance with an increment of 1. So as I insert the same block 4 times, I get block-1.dwg, block-2.dwg, block-3.dwg and block-4.dwg. Now I can manage color properties of each instance of the same symbol as needed.   

We use color to indicate what project an entity in a drawing is part of. Our drawings are living documents that may have 5 projects active going at the same time. Each project has a designated color. If I insert a new widget, it becomes red to indicate it's part of the most current project. In the same drawing next week, I insert another new widget (the same widget as last week) but for another project. It now becomes red and the 1st one gets changed to color 56. So on and so forth up to 5 colors for 5 different projects.

So I've built routines that hunt all red objects to change them to color 56. I have 10 routines for 5 colors, one to move entities to the next project color and 1 to change to bylayer if needed.

All of this works, and well enough. All of our symbols are simple lines and text. We don't mine any data though. We manually fill out an .mdb BOM and then fill out a second BOM in another program. I'm pushing to start using attributed blocks but I have to address the color control issue as part of the solution.

Hope that helps explain it a lil better

J. Logan
ACAD2015
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Increment the block name for each instance inserted.
« Reply #3 on: April 10, 2018, 01:13:05 PM »
If all you're doing is changing colors, make all block components within the block def color by block. Also, maybe post a sample drawing.
« Last Edit: April 10, 2018, 01:16:30 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

pendean

  • Mosquito
  • Posts: 20
  • "I am not a number, I am a free man"
Re: Increment the block name for each instance inserted.
« Reply #4 on: April 10, 2018, 01:13:45 PM »
All of this works, and well enough. All of our symbols are simple lines and text. We don't mine any data though

Explore the free add-in called INCREMENT at the Autodesk App Store for the task you want to do https://apps.autodesk.com/ACD/en/Detail/Index?id=8051485828049059617&appLang=en&os=Win32_64

jlogan02

  • Bull Frog
  • Posts: 327
Re: Increment the block name for each instance inserted.
« Reply #5 on: April 10, 2018, 02:41:20 PM »
If all you're doing is changing colors, make all block components within the block def color by block. Also, maybe post a sample drawing.

That has always been my fall back position RonJonP. Simple and easy. Nope!! "We want our line work to be this color and our text to be that color when not part of a project."

The attached example is the at rest state of a symbol. I've explained that we would have layers name something like Project 1, Project 2, Project 3 with each project being the project colors I mentioned earlier. New widget is inserted into the drawing and placed on the correct project layer. Could be dialog driven having the user specify which project this block is for while also filling out MFG or device specific info.

I think with enough discussion this is really how it should be anyway. Most of the functionality is already created in ACAD or lisp routines we already have. It's just a matter of convincing folks.

J. Logan
ACAD2018
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

jlogan02

  • Bull Frog
  • Posts: 327
Re: Increment the block name for each instance inserted.
« Reply #6 on: April 10, 2018, 02:42:01 PM »
All of this works, and well enough. All of our symbols are simple lines and text. We don't mine any data though

Explore the free add-in called INCREMENT at the Autodesk App Store for the task you want to do https://apps.autodesk.com/ACD/en/Detail/Index?id=8051485828049059617&appLang=en&os=Win32_64

I actually have this Dean. I'll look at it closer. thanks

J. Logan
ACAD2015
J. Logan
ACAD 2018

I am one with the Force and the Force is with me.
AutoCAD Map 2018 Windows 10

BIGAL

  • Swamp Rat
  • Posts: 1411
  • 40 + years of using Autocad
Re: Increment the block name for each instance inserted.
« Reply #7 on: April 10, 2018, 10:46:45 PM »
If you draw all your block details on layer 0 then when inserted in another layer they adopt that layers colour so no changing colour required. As you say each time add a project bump the layer color 1st and all your blocks will change color simply.
A man who never made a mistake never made anything