Jump to content

Quickly numbering (Numinc) with text frames in different colors


mickeforsberg

Recommended Posts

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

Link to comment
Share on other sites

  • 4 months later...
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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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!

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 3 weeks later...
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

Link to comment
Share on other sites

  • 2 weeks later...
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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!

 

 

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 4 months later...
On 11/5/2018 at 7:49 PM, dlanorh said:

I'm sure you'll give it a more extensive workout than i possibly could.:thumbsup: 

 

So, another six months later I'm taking this time to update you on your lisp. Better late than never!

 

I'm using it regularly and it works really well! I haven't found anything that I'm missing, except maybe the ability to not use "." or "/" in the addresses. Some addresses span from just plain "100"-"200" so I'm doing these manually at the moment. But it's no big deal.

 

I did find that the quickest way to change the address' frame colours was to just select every address manually afterwards and change the color. Usually I don't know beforehand what section (background color) the address belongs to. So the ability to choose colours in the lisp was unnecessary in the end. My bad for not realizing how I go about doing the drawings before asking! 😑

 

Thanks again dlanorh! 🍻

 

Edit: Wow those emojis are huge.

Edited by mickeforsberg
Link to comment
Share on other sites

  • 3 weeks later...
On 05/04/2019 at 06:37, mickeforsberg said:

 

So, another six months later I'm taking this time to update you on your lisp. Better late than never!

 

I'm using it regularly and it works really well! I haven't found anything that I'm missing, except maybe the ability to not use "." or "/" in the addresses. Some addresses span from just plain "100"-"200" so I'm doing these manually at the moment. But it's no big deal.

 

I did find that the quickest way to change the address' frame colours was to just select every address manually afterwards and change the color. Usually I don't know beforehand what section (background color) the address belongs to. So the ability to choose colours in the lisp was unnecessary in the end. My bad for not realizing how I go about doing the drawings before asking!

 

 

OK. Finally had time to get around to this. Attached is an updated lisp. This now incorporates a space " " and a dash "-" as the divider and allows the entry of a space as the prefix.

If the prefix is a space and the divider is a space these are removed when updating the block so you end up with just the suffix. I don't have the time to remove the color swatches as this necessitates work on both the dcl and lisp.

DevNos-V2.04.lsp

Link to comment
Share on other sites

On 4/26/2019 at 11:45 AM, dlanorh said:

 

OK. Finally had time to get around to this. Attached is an updated lisp.

Oh wow, thank you! You didn't have to do that! I'm grateful though, now it's perfect for my workflow! 🍻

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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