Jump to content

Cable Id Number Tag Lisp


The Buzzard

Recommended Posts

Hello Everybody,

 

I have a new block program here that is used to address or identify cable for IT construction. The blocks attribute tag information is assembled based on input. The block is then named by a section of this information to make it easier to get an accurate count of a particular group of of Id tags which can be done with any good block count program. Once this block has been inserted it starts out with a number 001 as the first numbered tag of the group. You can enter any three digit number you wish to start out with. With each insertion of this block the sequence number will increase by 1. Also to make this program even more interesting depending on where the insertion point to it orientation angle is set, The block will rotate the attribute automatically to read in proper drafting reading direction. (From the drawing bottom and or from the right of the drawing.) It will also put each block on its designated layer with the color set. Even if this program holds no value to you, I am sure you will find its technique interesting all the same. To give you an idea as to what the block looks like and the results after insertion, I have provided a sample image below. Also there is a sample image of the dialog as well.

 

So the advantages with this code are:

 

No searching or remembering where the block is or what it was called.

No need to manually change attribute values.

No need to manipulate attributes after insertion.

You do not have to set or create the layer.

 

Disadvantages:

To modify the block other than what you see here would require code modification.

 

The biggest issue I had with this program was trying to do multiple attribute editting within one selection set which is now resolved thanks to Lee Mac. Also another issue was using leading zeros in the sequence number which was also resolved with the help of alanjt. A thanks to David Bethel for his knowledge of entmake. CAB gets much credit for arguments and other techniques and Kenny ramage of Afralisp for getting started with coding in the first place.

 

Here is the thread for the selection set issue I had with making this program.

 

Selection Sets

http://www.cadtutor.net/forum/showthread.php?53165-Stepping-thru-selection-set-for-a-single-attribute-multiple-times.

 

 

The code is called CIT.lsp & CIT.dcl

Command Syntax is: CIT to start program.

 

Take the code for a spin in any case if you can use it or not.

 

Enjoy the code and I look forward to your input.

Thanks,

The Buzzard

 

Attention! Revision V0.1 has been added. 10.14.10

;
;
; Revisions.
; Note: Be sure to add the most recent revision date and version in the About Dialog Page. 
;-----------------------------------------------------------------------------------------
; Version | Change                                                        |     | Date
;-----------------------------------------------------------------------------------------
[color=red][b]; V0.1    | Turn off orthomode for use with polar tracking                | AMB | 10|14|10[/b][/color]
[b][color=red]; V0.1    | Error trap Seq No. for invalid entries                        | AMB | 10|14|10[/color][/b]
; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
;

Document1.jpg

Document2.JPG

CIT_V0.1.zip

Edited by The Buzzard
Revision V0.1 added to post
Link to comment
Share on other sites

One thing. Polar tracking does not come back on once the program is complete. Perhaps this may be of use to you??

 

I got this from Lee Mac a while back. Toggle's Polar tracking

 
(setvar 'AUTOSNAP (boole 6 (getvar 'AUTOSNAP) )

 

As always, great programming and thank you for sharing!

Link to comment
Share on other sites

One thing. Polar tracking does not come back on once the program is complete. Perhaps this may be of use to you??

 

I got this from Lee Mac a while back. Toggle's Polar tracking

 
(setvar 'AUTOSNAP (boole 6 (getvar 'AUTOSNAP) )

 

As always' date=' great programming and thank you for sharing![/quote']

 

 

Lt. Dan legs,

 

If you can do me this favor, I have uploaded another copy which I hope will fix this. Please test it out and let me know what you find.

Link to comment
Share on other sites

The only connection to this that I could find is when orthomode is on polarmode goes off automatically. I placed a provision to save the user autosnap & polarmode upon code start-up and turn off orthomode while running the code. If a user prefers orthomode to be on, They can turn it on at will. See how this works out and que me in as to how this operates.

 

 

Autosnap

Type: Integer

Saved in: Registry

Initial value: 63

Controls AutoSnap marker, tooltip, and magnet. Also turns on polar and object snap tracking, and controls the display of polar and object snap tracking tooltips. The system variable value is the sum of the following bit values:

 

0 Turns off the AutoSnap marker, tooltips, and magnet. Also turns off polar tracking, object snap tracking, and tooltips for polar and object snap tracking

1 Turns on the AutoSnap marker

2 Turns on the AutoSnap tooltips

4 Turns on the AutoSnap magnet

8 Turns on polar tracking

16 Turns on object snap tracking

32 Turns on tooltips for polar tracking and object snap tracking

 

In order for the autosnap markers to be on + polar tracking + object snap tracking the autosnap needs to be set to 25. See below.

These are the settings during program operation.

;
; F14 - Change Program Settings.
;
(defun CIT_CPS ()
 (setq CPS (list 0 0 0 0 0 25 7))
 (mapcar (function setvar)(list "cmdecho" "blipmode" "orthomode" "angbase" "angdir" "autosnap" "polarmode") CPS)
 (princ))
;

 

Currently, This is how it is set in the code.

 

 

Take note below upon start-up that the user autosnap and polarmode are saved, So they should restore at program end or in the event of an error.

;
; F03 - Start-Up.
;
(defun C:CIT (/ ATAG$ BNAM$ BSCL# BSCL_LST BTAG$ BTAG_LST CPS DCL_ID DEG# ELST ENAM FLRN$ FSTY$
               IANG IDFR$ IDFR_LST INPT OLMN$ RAD# SEQN$ SEQN# SSET SUS TERR UCLK *error*)
 (setq SUS_LST (list "cmdecho" "blipmode" "orthomode" "osmode" "angbase" "angdir" "clayer" "polarmode" "autosnap")
       SUS (mapcar 'getvar SUS_LST)
       TERR *error*
      *error* CIT_ET)
 (CIT_MF)
 (princ))
(princ "Cable Id Tag Lisp, CIT.lsp - Copyright © 2010")
(princ "\nType CIT to start program.")
;

 

 

Thanks

Edited by The Buzzard
Link to comment
Share on other sites

Guest kruuger

Hi Buzzard

 

I want play with you program but there is a problem with DCL file:

1. DCL file should be CIT no CLT i guess.

2. No "main" dialog in DCL file

 

kruuger

Link to comment
Share on other sites

Hi Buzzard

 

I want play with you program but there is a problem with DCL file:

1. DCL file should be CIT no CLT i guess.

2. No "main" dialog in DCL file

 

kruuger

 

Sorry about that, Grabbed the wrong dcl by mistake. The zip file is now replaced.

Link to comment
Share on other sites

Guest kruuger

thank you. now works fine. i like the Function Description in your file :)

i noticed that we can enter Seq No like: asd (letters) or 01 and first attribute is with this value.

 

maybe you should check for correct value of Seq No when you leave this edit box.

when value is incorrect then convert to 00X, for example: asas-> to 001, 03->003, 09->009 etc.

Link to comment
Share on other sites

thank you. now works fine. i like the Function Description in your file :)

i noticed that we can enter Seq No like: asd (letters) or 01 and first attribute is with this value.

 

maybe you should check for correct value of Seq No when you leave this edit box.

when value is incorrect then convert to 00X, for example: asas-> to 001, 03->003, 09->009 etc.

 

 

Yeah, I noticed that also. I will see what I can come up with to fix that. As long as you do not make an entry mistake, You should OK. But you are right.

Link to comment
Share on other sites

Attention All,

 

I fixed the issue with the problem of more or less leading zeros. It will automatically correct the problem. Where an invalid enty is concerned, The program enters a message at the command prompt and returns to the dialog to allow you to correct it. Also turned off orthomode to allow polar tracking to work. If you do not use polar tracking, You can always toggle orthomode back on.

 

Look for revision V0.1 - 10.14.10 in the revision list on the first post.

Thanks

The Buzzard

Link to comment
Share on other sites

Everything seems to work great. Nice job Buzzard!

 

Thanks' date='

 

But one thing I noticed was when it reports back the Seq No. error, It prints it to the command line horizontally. I just added (terpri) in the statement and it looks much better now. I also shortened the message.

 

I added this.

     (cond
       ((= SEQN# nil)(princ "Attention! Invalid Seq No.")[color=red](terpri)[/color](CIT_MF))
       (T))))

 

 

To get this to print vertically.

Attention! Invalid Seq No.
Attention! Invalid Seq No.
Attention! Invalid Seq No.
Attention! Invalid Seq No.
Attention! Invalid Seq No.
Attention! Invalid Seq No.

Link to comment
Share on other sites

looks great now :)

kruuger

 

Thanks alot for your input kruuger. There seems to be alot to consider when programs are assembled. I have been busy making notes to myself for future reference.

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