+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
  1. #1
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default Cable Id Number Tag Lisp

    Registered forum members do not see this ad.

    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/showth...ultiple-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
    Code:
    ;
    ;
    ; Revisions.
    ; Note: Be sure to add the most recent revision date and version in the About Dialog Page. 
    ;-----------------------------------------------------------------------------------------
    ; Version | Change                                                        |     | Date
    ;-----------------------------------------------------------------------------------------
    ; V0.1    | Turn off orthomode for use with polar tracking                | AMB | 10|14|10
    ; V0.1    | Error trap Seq No. for invalid entries                        | AMB | 10|14|10
    ; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
    ; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
    ; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
    ; XXXX    | XXXXX                                                         | XXX | XX|XX|XX
    ;
    Attached Images
    Attached Files
    Last edited by The Buzzard; 14th Oct 2010 at 04:44 pm. Reason: Revision V0.1 added to post

  2. #2
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    611

    Default

    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
    Code:
     
    (setvar 'AUTOSNAP (boole 6 (getvar 'AUTOSNAP) 8))
    As always, great programming and thank you for sharing!

  3. #3
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Quote Originally Posted by Lt Dan's legs View Post
    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
    Code:
     
    (setvar 'AUTOSNAP (boole 6 (getvar 'AUTOSNAP) 8))
    As always, great programming and thank you for sharing!

    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.

  4. #4
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    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.
    Code:
    ;
    ; 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.
    Code:
    ;
    ; 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

  5. #5
    kruuger
    Guest

    Default

    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

  6. #6
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Quote Originally Posted by kruuger View Post
    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.

  7. #7
    kruuger
    Guest

    Default

    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.

  8. #8
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    Quote Originally Posted by kruuger View Post
    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.

  9. #9
    Forum Deity
    Using
    AutoCAD 2009
    Join Date
    Oct 2008
    Posts
    2,112

    Default

    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

  10. #10
    Super Member Lt Dan's legs's Avatar
    Using
    AutoCAD 2007
    Join Date
    May 2010
    Location
    Florida
    Posts
    611

    Default

    Registered forum members do not see this ad.

    Everything seems to work great. Nice job Buzzard!

Similar Threads

  1. Lisp: coordinates of points to excel sheet (+point number)
    By janwillem89 in forum AutoLISP, Visual LISP & DCL
    Replies: 123
    Last Post: 1st Jul 2017, 07:33 am
  2. Lisp for adding number to multiple text entities?
    By EvilSi in forum AutoLISP, Visual LISP & DCL
    Replies: 25
    Last Post: 15th May 2015, 01:01 pm
  3. Lisp to insert positional number
    By Tiger in forum AutoLISP, Visual LISP & DCL
    Replies: 33
    Last Post: 27th Aug 2010, 07:32 am
  4. How to get serial number of hard drive by lisp?
    By nataca in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 23rd Apr 2009, 07:49 am
  5. rounding a number with lisp
    By cmoxey in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 2nd Apr 2006, 07:36 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts