+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
  1. #1
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Question Another "First" - Text to Linework

    Registered forum members do not see this ad.

    I have a co-worker looking for a way to make certain strings of text into linework. Is this even possible? I thought there might be a LISP routine out there that does something like this.

    Example: Carthage County Line = ---- -- ---- -- ---- -- ---- (or something)
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

  2. #2
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,952

    Default

    ... Not sure I fully understand what you're requesting; perhaps this is what you're after?

    http://apps.exchange.autodesk.com/AC...-Geometry%3aen
    "Potential has a shelf life." - Margaret Atwood

  3. #3
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Default

    Thanks RenderMan but I'm not looking for the lines that make up the text to become linework.

    I'm wanting something to read "County Line" and make a line in the drawing with a phantom linetype. I don't even know if something like this is even possible?
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

  4. #4
    Forum Deity BlackBox's Avatar
    Using
    Civil 3D 2011
    Join Date
    Nov 2009
    Posts
    3,952

    Default

    You want "County Line" to be the command, or something found in the drawing... I am still not understanding.

    If I am understanding you correctly, you're wanting a routine to detect a *Text entity that includes (or consists of) "County Line" in the Objects TextString, and then you want the code to create a *Line entity within the drawing's ModelSpace? Where?

    Perhaps a before and after pic would help? More information is needed, methinks.
    "Potential has a shelf life." - Margaret Atwood

  5. #5
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Default

    Quote Originally Posted by RenderMan View Post
    If I am understanding you correctly, you're wanting a routine to detect a *Text entity that includes (or consists of) "County Line" in the Objects TextString, and then you want the code to create a *Line entity within the drawing's ModelSpace? Where?

    Perhaps a before and after pic would help? More information is needed, methinks.
    This is exactly what I'm looking for! Is this possible? Again, this is more of a curiosity than a necessity.
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

  6. #6
    Super Member Tyke's Avatar
    Computer Details
    Tyke's Computer Details
    Operating System:
    Windows 7 - 64 bit, Vista and XP Pro
    Computer:
    HP Z400 Workstation
    CPU:
    Intel(R) Xeon(R) CPU W3530 @ 2.80GHz
    RAM:
    8 GB
    Graphics:
    Nvidia Quadro 600 1GB DDR3
    Primary Storage:
    2x 500GB HDD RAID 1 and Western Digital 2TB NAS RAID 1
    Secondary Storage:
    Lacie external HDD 2TB Raid Level 1
    Monitor:
    Samsung SyncMaster P2770HD, 2443 and 193T
    Discipline
    Multi-disciplinary
    Tyke's Discipline Details
    Occupation
    Surveyor, programmer, civil engineer
    Discipline
    Multi-disciplinary
    Details
    Surveying and civil engineering. As built utilities surveys and data maintenance in GIS systems. Building surveys, measured and laser scanning. Setting out of all civil works. Control and settlement surveys. Programming in AutoCAD, MicroStation, Geograf and stand alone applications for all uses.
    Using
    Civil 3D 2013
    Join Date
    Jun 2006
    Location
    Saxony, Germany
    Posts
    866

    Default

    Is this something like in a drawing legend? Could the start point of the line be a set vertical and horizontal offset from the insertion point of the text and the line a set length? Or does the line need start and end points?
    Engage brain before mouth

    "The German who types with a Yorkshire accent" - Dave Broada 2o1o

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,743

    Default

    Maybe something like this?

    Code:
    ;; Text Linetype  -  Lee Mac
    ;; Creates and loads a custom linetype containing the specified text.
    ;; The linetype will use the Standard TextStyle in the linetype definition.
    ;; The space between dashes in the linetype is calculated based on the number of
    ;; characters in the supplied string, with an additional spacing of 0.05 drawing units.
    ;; Using a monospace font for the linetype will produce the best results.
    
    (defun c:txtlt ( / *error* des str tmp val var )
    
        (defun *error* ( msg )
            (mapcar 'setvar var val)
            (if (= 'file (type des))
                (close des)
            )
            (if (and tmp (findfile tmp))
                (vl-file-delete tmp)
            )
            (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
                (princ (strcat "\nError: " msg))
            )
            (princ)
        )
        
        (cond
            (   (= "" (setq str (getstring t "\nSpecify Text for Linetype: "))))
            (   (null
                    (and
                        (setq tmp (vl-filename-mktemp nil nil ".lin"))
                        (setq des (open tmp "w"))
                        (write-line (strcat "*" str "," str " ----" str "----" str "----") des)
                        (write-line (strcat "A,.5,-.05,[\"" str "\",STANDARD,S=.1,R=0.0,X=0.0,Y=-.05]," (rtos (- (/ (strlen str) -10.0) 0.05) 2 1)) des)
                        (not (setq des (close des)))
                        (findfile tmp)
                    )
                )
                (princ "\nUnable to create custom linetype definition.")
            )
            (   (progn
                    (setq var '(cmdecho expert)
                          val  (mapcar 'getvar var)
                    )
                    (mapcar 'setvar var '(0 5))
                    (command "_.-linetype" "_L" "*" tmp "")
                    (mapcar 'setvar var val)
                    (vl-file-delete tmp)
                    (tblsearch "LTYPE" str)
                )
                (princ (strcat "\n" str " linetype created successfully."))
            )
            (   (princ (strcat "\nUnable to load linetype " str)))
        )
        (princ)
    )
    (princ)
    Or have I misunderstood?
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  8. #8
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Default

    Capture.jpg

    Does this help?

    Select "COUNTY LINE" and from that, create a line/polyline at a certain length with a PHANTOM linetype. (Just as an example)
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

  9. #9
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Default

    Quote Originally Posted by Lee Mac View Post
    Maybe something like this?

    Code:
    ;; Text Linetype  -  Lee Mac
    ;; Creates and loads a custom linetype containing the specified text.
    ;; The linetype will use the Standard TextStyle in the linetype definition.
    ;; The space between dashes in the linetype is calculated based on the number of
    ;; characters in the supplied string, with an additional spacing of 0.05 drawing units.
    ;; Using a monospace font for the linetype will produce the best results.
    
    (defun c:txtlt ( / *error* des str tmp val var )
    
        (defun *error* ( msg )
            (mapcar 'setvar var val)
            (if (= 'file (type des))
                (close des)
            )
            (if (and tmp (findfile tmp))
                (vl-file-delete tmp)
            )
            (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))
                (princ (strcat "\nError: " msg))
            )
            (princ)
        )
        
        (cond
            (   (= "" (setq str (getstring t "\nSpecify Text for Linetype: "))))
            (   (null
                    (and
                        (setq tmp (vl-filename-mktemp nil nil ".lin"))
                        (setq des (open tmp "w"))
                        (write-line (strcat "*" str "," str " ----" str "----" str "----") des)
                        (write-line (strcat "A,.5,-.05,[\"" str "\",STANDARD,S=.1,R=0.0,X=0.0,Y=-.05]," (rtos (- (/ (strlen str) -10.0) 0.05) 2 1)) des)
                        (not (setq des (close des)))
                        (findfile tmp)
                    )
                )
                (princ "\nUnable to create custom linetype definition.")
            )
            (   (progn
                    (setq var '(cmdecho expert)
                          val  (mapcar 'getvar var)
                    )
                    (mapcar 'setvar var '(0 5))
                    (command "_.-linetype" "_L" "*" tmp "")
                    (mapcar 'setvar var val)
                    (vl-file-delete tmp)
                    (tblsearch "LTYPE" str)
                )
                (princ (strcat "\n" str " linetype created successfully."))
            )
            (   (princ (strcat "\nUnable to load linetype " str)))
        )
        (princ)
    )
    (princ)
    Or have I misunderstood?
    Thanks Lee! That works pretty slick but not exactly what I'm looking for.
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

  10. #10
    Senior Member Squirltech's Avatar
    Computer Details
    Squirltech's Computer Details
    Operating System:
    Windows 7 Enterprise, Service Pack 1
    Computer:
    @xi
    RAM:
    32.0 GB
    Primary Storage:
    230 GB
    Monitor:
    Dual Dell 21"
    Discipline
    Surveying
    Squirltech's Discipline Details
    Occupation
    Senior Survey Technician
    Discipline
    Surveying
    Using
    Civil 3D 2009
    Join Date
    Oct 2010
    Location
    30 15' N, 97 44' W
    Posts
    162

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Tyke View Post
    Is this something like in a drawing legend? Could the start point of the line be a set vertical and horizontal offset from the insertion point of the text and the line a set length? Or does the line need start and end points?
    It would be really handy for creating a legend Tyke! I hadn't thought of that but it's a great idea.
    T. Nelson
    Sr. Survey Technician
    http://www.saminc.biz

    "The only thing left to do is EVERYTHING!" - Jesse James

Similar Threads

  1. Export properties ("measurement") of "Aligned Dimension" to Excel
    By nhatquyelec in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 1st Feb 2013, 07:58 am
  2. Replies: 17
    Last Post: 24th Jan 2013, 05:34 pm
  3. Replies: 0
    Last Post: 21st Jan 2011, 05:20 pm
  4. Replies: 1
    Last Post: 25th Nov 2009, 06:35 pm
  5. Replies: 4
    Last Post: 3rd Sep 2008, 01:11 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