Sequential numbering with suffix only for identical blocks

Sequential numbering with suffix only for identical blocks

yannick.vanwallendael67GKS
Participant Participant
1,297 Views
13 Replies
Message 1 of 14

Sequential numbering with suffix only for identical blocks

yannick.vanwallendael67GKS
Participant
Participant

Hi all,

 

I'm new to LISP and I've looked for existing topics that do the trick for us but we did not manage to find any sufficient solution.  

 

What we're basically trying to do is creating schemes with existing blocks from an existing library. Each block has its own attributes concerning codes, descriptions, etc. 

When we've inserted all our needed blocks we would like to automatically number all these blocks in the drawing, BUT identical blocks (i.e. only identical blocks with identical attribute information) need to be numbered with the same number along with a suffix (letter).

 

So e.g. we've used 6 blocks of which 3 are fully identical then we would like to have the numbering as follows: 01, 02, 03, 04A, 04B, 04C.

 

Any help would be greatly appreciated, thanks!

0 Likes
Accepted solutions (2)
1,298 Views
13 Replies
Replies (13)
Message 2 of 14

3wood
Advisor
Advisor

You can try ALTEXT.

Download it from here, try it as a trial version or get a free registration.

 

Step 1. Use ALTEXT to change all target attribute value to 1.

ALTEXT4.gif

 

Step 2. Draw a polyline or polylines to represent number sequence paths near the target attributes.

ALTEXT5.gif

 

Step 3. Download Formula 15, then use ALTEXT with "Along paths" and "Use formula" option to change target numbers.

ALTEXT6.gif

Message 3 of 14

stevor
Collaborator
Collaborator

Just curious, are you referring to the INSERTs of of these BLOCKs?

And about 'numbering,' what do want, in Autocad terminology?

 

S
0 Likes
Message 4 of 14

yannick.vanwallendael67GKS
Participant
Participant

Thanks, it helps us out a little bit but it is not yet what we are looking for. 

 

We would like to be able to select all the blocks in our file together without drawing a polyline. Whereafter all blocks will be numbered (e.g. Left-Right/ Up-Down, identical blocks will be given an alphabetic suffix). Actually I think you understand what I ment in the post before but it only works when the identical blocks are following up one another . 

 

E.g. if I now have a combination of blocks A-A-B-B-B they will be numbered 01A-01B-02A-02B-02C. Which is what we would like to become. But when I create the combination A-B-A-B-A-B-A-B-A-B, the numbering will be 01-02-03-04-05-06-07-08-09-10 while we would like it to be 01A-02A-01B-02B-01C-02C-01D-02D-01E-02E.

 

And an important item for us is the fact that if numbering as above the part list will be very long because of the fact that AutoCAD only combines identical rows so it means when numbering is different(i.e. the suffix) every block will be showed individually while we would like blocks 01A, 01B and 01C being represented as item '01' in the parts list... 

 

0 Likes
Message 5 of 14

yannick.vanwallendael67GKS
Participant
Participant

We've defined some attributes, wherefrom one is the 'number'.  With 3woods solution it is possible to renumber this attribute, which is good but just not yet  what we desire. 

 

For more explanation read my reply above to 3wood.

0 Likes
Message 6 of 14

hak_vz
Advisor
Advisor

First of all, attach sample drawing with as many blocks you use.

Problem  is practically unsolvable if we don't know which attributes to compare, in what order. One block can have two attributes, other five. Values of attributes can be ( a b c)( c a b) (b c a), so blocks can have same values but distributed in different order.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 7 of 14

3wood
Advisor
Advisor
Accepted solution

I have updated both ALTEXT and its Formula 15.

Please download and replace your copy and try again.

Now you don't need set the attribute representing the number sequence to 1 at beginning.

You can also use all 4 methods of "Sort selection" including "Left-Right/Up-Down" and "Along paths" to define the number sequence.

Alphabet limits to "Z".

Here is the result:

ALTEXT8.gif

0 Likes
Message 8 of 14

yannick.vanwallendael67GKS
Participant
Participant

Thanks very much!!! That's exactly what we were looking for.

 

Remains the issue with how to combine then when extracting data. Does anybody know if it's possible to combine 5 rows (01A-01B-01C-01D-01E) to just one (01)? Example below.

AutoCAD automatically combines identical rows but because of the fact that we have different numbers here, they will be shown individually... 

yannickvanwallendael67GKS_0-1641383052809.png

 

 

 

0 Likes
Message 9 of 14

3wood
Advisor
Advisor

Do you consider creating a new attribute to represent the alphabet?

eg.

Attribute 1: Sequence number 01, 02, 03 ...

Attribute 2: Sequence alphabet A, B, C, D, ... or blank.

Attribute 3: ...

Then you can fill in the first attribute with numbers only and it is easier to sort.

0 Likes
Message 10 of 14

yannick.vanwallendael67GKS
Participant
Participant

That's indeed what we were thinking about. I think it will be the easiest way to solve this...

0 Likes
Message 11 of 14

yannick.vanwallendael67GKS
Participant
Participant

We would like to start working again on this topic and we want to use this method @3wood. Can you foresee a formula to number the blocks (1st attribute; identical blocks will get identical numbers) with an additional option to add a letter (2nd attribute; only for multiple used blocks).

 

Thanks in advance! 

0 Likes
Message 12 of 14

3wood
Advisor
Advisor
Accepted solution

I have updated the formula. Please download it (Formula 15) from here: https://sites.google.com/site/cadkits/home/altext

Please update your block definition, add the second attribute to represent the alphabet sequence and use BATTMAN to synchronize the blocks, ensure the number sequence is the first attribute and the alphabet sequence is the second attribute.

 

0 Likes
Message 13 of 14

yannick.vanwallendael67GKS
Participant
Participant

@3wood I implemented your formula and tried it out, although it seemed pretty good it somehow mixes up some blocks. 

I use 5 attributes, of which the first one is the number and the second is the alphabetic sequence. When I run the formula, 2 blocks with all attributes identical except the 3th (code) will be given the same number. See attachment. Any idea what causes this?

 

yannickvanwallendael67GKS_0-1643352976501.png

Block 1A:

yannickvanwallendael67GKS_1-1643353029021.png

Block 1B:

yannickvanwallendael67GKS_3-1643353091015.png

0 Likes
Message 14 of 14

yannick.vanwallendael67GKS
Participant
Participant

It does the trick now. 

Thank you very much! 🙌

0 Likes