Jump to content
mickeforsberg

Quickly numbering (Numinc) with text frames in different colors

Recommended Posts

dlanorh

attached is the updated lisp, associated dcl file and a drawing containing the updated block.

 

 

The lisp is dialog driven. The dcl file needs to be in a directory in the autocad support path.

 

 

Dialog has two buttons "Pick" and "Cancel" Use Canel to quit the lisp. Pick hides the dialog while blocks are selected. A null selection will return you to the dialog to set up a different format/colour.

 

 

Colours are picked by clicking on the relevant colour swatch. The selected swatch should match the colour selected. The toggle is used to turn updating of colour on or off. When off the selected swatch will be grey.

 

 

There are 2 edit boxes. The left one is for the prefix, the right the suffix (number to be incremented) This must be a number. The prefix will allow letters or numbers. Letters will be capitalised.

 

 

The middle is a popup with 5 choices for the divider, a space, a point, a slash, a comma or a colon. Select the one you require

dev_id_block.dwg

dev_nos.dcl

DevNos-V2.lsp

Share this post


Link to post
Share on other sites
mickeforsberg
On 5/14/2018 at 7:03 PM, dlanorh said:

attached is the updated lisp, associated dcl file and a drawing containing the updated block.

 

I'm sorry for the half a year delay! I just got other things to do after your post and then I forgot about it completely.

I did try out your improved lisp today, and it's working great! I've decided to change the text frame colors somewhat so I have updated the lisp and dcl. Also I changed the frame width to 0.1 instead of 0.05 to make it stand out a bit more. 

 

If you'd like another challenge: Is it possible to have it remember the last address you changed when you canceled the command? So if I put 1.010 last and then cancel the command, next time I start "inca" it will fill in 1.011 automatically. I know Lee Mac's NumInc does this and it's pretty nifty! It would be great since then I'd just have to change the color of the frame and continue.

 

If this can't be done, perhaps a workaround is possible. I'm thinking that if I just used the (for example) grey frame and used it for all the addresses. When done, perhaps there could be a function in the dcl to just select a border color and pick those addresses that belongs to that color. If you know what I mean? So if I select Orange, there would be a button to "select addresses" and then you can pick the blocks which you want to have the orange frame.

 

Really great work dlanorh! 🍻

 

Edit: Oh and I attached the lisp and dcl with the updated colors in case you'd want to continue with this project.

 

 

 

dev_nos_updated_col.dcl

DevNos-V2_updated_col.lsp

Edited by mickeforsberg

Share this post


Link to post
Share on other sites
dlanorh

I'll have a look, but I'm quite busy (work wise) at the moment so I don't know how long it will take. I should be able to do this with either

 

1.  a global variable (only available whilst drawing open, then lost)

2.  a blackboard variable (available whilst autocad open then lost)

3   a dictionary item in the drawing (available in a specific drawing, but available each time the drawing is opened)

 

There are probably more options, but can't think of them at the moment. The choice is yours.

 

Share this post


Link to post
Share on other sites
mickeforsberg
2 hours ago, dlanorh said:

I'll have a look, but I'm quite busy (work wise) at the moment so I don't know how long it will take. I should be able to do this with either

Of course, there is no rush (obviously, since it took me 4 months to reply previously).

 

I don't think there's a reason for the variable to be available each time the drawing is closed and opened again, in my specific case. Nr 1 seems like a good option!

Share this post


Link to post
Share on other sites
dlanorh
39 minutes ago, mickeforsberg said:

Of course, there is no rush (obviously, since it took me 4 months to reply previously).

 

I don't think there's a reason for the variable to be available each time the drawing is closed and opened again, in my specific case. Nr 1 seems like a good option!

 

OK I'll run with that.

  • Thanks 1

Share this post


Link to post
Share on other sites
dlanorh
On 25/09/2018 at 12:22, mickeforsberg said:

Of course, there is no rush (obviously, since it took me 4 months to reply previously).

 

I don't think there's a reason for the variable to be available each time the drawing is closed and opened again, in my specific case. Nr 1 seems like a good option!

 

Attached are updated lisp and dcl file, based on the revised lisp and dcl you supplied. If you want to "translated" any button or box text, you can alter any [label = "*";] string in the dcl file.

 

I've changed the dcl to include a reset button alongside the text string composer. This will allow a quick way to reset the increment number to 1 when required. I've only minimally tested it, so any problems please get back to me.

 

 

dev_nos.dcl

DevNos-V2.01.lsp

Share this post


Link to post
Share on other sites
mickeforsberg
On 10/16/2018 at 12:28 PM, dlanorh said:

 

Attached are updated lisp and dcl file, based on the revised lisp and dcl you supplied. If you want to "translated" any button or box text, you can alter any [label = "*";] string in the dcl file.

 

I've changed the dcl to include a reset button alongside the text string composer. This will allow a quick way to reset the increment number to 1 when required. I've only minimally tested it, so any problems please get back to me.

 

I'm running into some kind of error when I cancel the command and bring up "inca" again.

I get this error: "Oops an error: Bad argument type: stringp 1 occurred".

I tried just putting the lsp in Documents folder, and I got the same kind of error, only "stringp 104 occurred" instead. Though I guess that would just be because I used the command a bit more before cancelling.

 

Any thoughts?

Share this post


Link to post
Share on other sites
dlanorh

How are you cancelling the command? Are you using the exit button or the cross top right of the dialog?

 

I can reproduce the error intermittantly, but at present I can't find what is causing it.

Edited by dlanorh
spelling

Share this post


Link to post
Share on other sites
dlanorh

OK, I think I've solved the problem. One of the if statements was missing an else. I have updated it so that it also remembers the last prefix and frame colour.

 

Attached is latest version.

 

Any problems let me know.

 

DevNos-V2.02.lsp

Share this post


Link to post
Share on other sites
mickeforsberg
On 10/29/2018 at 1:06 PM, dlanorh said:

OK, I think I've solved the problem. One of the if statements was missing an else. I have updated it so that it also remembers the last prefix and frame colour.

 

Attached is latest version.

 

Any problems let me know.

 

DevNos-V2.02.lsp

 

Yes now it works, thanks! I did find another thing though. Let's say I'm using it to put addresses from 1.001 to 1.075 and I need to delete one of the addresses in the middle so the addresses after that one needs to be adjusted. If I then manually type (e.g.) 1.021, it seems to still think it's 1.076 (the next one in line) and after it is placed the next address becomes 1.077 instead of 1.022.

I thought perhaps the reset would work but if I reset and change the 1.001 to 1.021 - after 1.021 is placed the next address is 1.002, as if it still works as if 1.001 was placed.

 

Kind of a long-spun explanation, I hope you get what I mean. Cheers!

 

 

 

 

Share this post


Link to post
Share on other sites
dlanorh
1 hour ago, mickeforsberg said:

Yes now it works, thanks! I did find another thing though. Let's say I'm using it to put addresses from 1.001 to 1.075 and I need to delete one of the addresses in the middle so the addresses after that one needs to be adjusted. If I then manually type (e.g.) 1.021, it seems to still think it's 1.076 (the next one in line) and after it is placed the next address becomes 1.077 instead of 1.022.

I thought perhaps the reset would work but if I reset and change the 1.001 to 1.021 - after 1.021 is placed the next address is 1.002, as if it still works as if 1.001 was placed.

 

Kind of a long-spun explanation, I hope you get what I mean. Cheers!

 

I will take a look. I must have changed or omitted something.

Share this post


Link to post
Share on other sites
dlanorh

Attached is Lisp version 2.03.

 

I forgot to update the global variables for both the increment number and the prefix when you change them in the dialog. :cry:

I have tested this version and it now seems to work correctly. I'm sure you'll give it a more extensive workout than i possibly could.:thumbsup: 

 

Any further problems let me know.

DevNos-V2.03.lsp

Edited by dlanorh
spelling

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×