auto numbering excel

auto numbering excel

kim.dedeyne
Participant Participant
3,493 Views
10 Replies
Message 1 of 11

auto numbering excel

kim.dedeyne
Participant
Participant

Hello,

 

I have an ExcelDocument in which I insert the lengths and widths of my rectangles, so I copy the text in the green that I paste in the commandline. But can I include the numbering that I make in Column "J" so that the numbering is in the correct rectangle?

 

thanks in advance!

Kim

0 Likes
Accepted solutions (2)
3,494 Views
10 Replies
Replies (10)
Message 2 of 11

steven-g
Mentor
Mentor
Accepted solution

Hallo Kim,

 

You can add another column of formulas and if you select both rows they will be run consecutively, you may want to add an offset to the starting point  (the "non" keyword is to stop Autocad snapping to the start point of the rectangle).

Excel2.JPG

0 Likes
Message 3 of 11

kim.dedeyne
Participant
Participant

Hi,

 

It works perfect! is there a way to automatically measure it?

 

thx

 

 

0 Likes
Message 4 of 11

steven-g
Mentor
Mentor

Just add a third and fourth column, you have the coordinates for the corners, you only need to give the dimlinear command a third set of coordinates which is an offset to the outside of the rectangle, again you can find this from the coordinates, just make allowances for your dimension text sizes.

0 Likes
Message 5 of 11

kim.dedeyne
Participant
Participant

can you give an example of the formula?

0 Likes
Message 6 of 11

steven-g
Mentor
Mentor

Oops sorry my mistake. The text item needs to be the last in the row or it fails, so the second column of formulas should read

="_dli " & N1 & "," & O1 & " " & N1 & "," & Q1 & " " & N1-50 & "," & (P1-N1)/2

and the third column

="_dli " & N1 & "," & Q1 & " " & P1 & "," & Q1 & " " & Q1+50 & "," & (P1-N1)/2

using text items in an excel script usually calls for special treatment as Autocad doesn't know when text stops with a space as return because in text a space is a space.

0 Likes
Message 7 of 11

kim.dedeyne
Participant
Participant

HI

 

is there a mistake with the column "Q"? it does not work ...
0 Likes
Message 8 of 11

kim.dedeyne
Participant
Participant

excel doc

0 Likes
Message 9 of 11

steven-g
Mentor
Mentor

In your original document "R" was the empty column, you will need to adjust the formulas to suit

0 Likes
Message 10 of 11

kim.dedeyne
Participant
Participant

HI 

 

First of all , thanks for all your work and information. now the dimensions come on only those of the lengths are not correctly positioned. can I put them in a certain layer? as well as the numbering in another layer?

Thanks again it saves me a lot of work

 

Kim

0 Likes
Message 11 of 11

steven-g
Mentor
Mentor
Accepted solution

It looks like on your second bemating that you are adding 50 to the "x" part of the coordinates and it should be on the "y" part if you want it to be above the rectangles. It would also be an idea to turn off snapping before running this, because depending on the zoom level Autocad will still try to snap to objects close to script coordinates (or you can use the "non" keyword before every set of coordinates).

You can add in as many columns as you like (other than text based commands that can be difficult) so you could add in a column before the dimensions and another in front of the text to change layers, you would then need to add another right at the start to set the layer for drawing the rectangles.

Run the "layer" command from the keyboard and make note of the sequence of keystrokes that you need to enter in order to change layers, including how many <enters> (blank spaces) you need to exit the command. --TIP-- as the script jumps between excel cells it also counts that as an <enter> so you might need to play with how many spaces you use. Try it and see how you get on.

I don't mind helping, but custom programming services is something else. If you get stuck then post a copy of the actual excel file you have tried, it will be easier to debug if I can see the formulas and not have to type them out again.

Good Luck

0 Likes