+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Dec 2009
    Posts
    152

    Default (read (strcat "(" "TUBE150X150X4.5 20.2" ")"))

    Registered forum members do not see this ad.

    Please help in this issue.

    (read (strcat "(" "TUBE150X150X4.5 20.2" ")"))

    it returns a list
    (TUBE150X150X4 20.2).

    But I need a list
    (TUBE150X150X4.5 20.2) including decimal point.

    Yours,
    Muthu.

  2. #2
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    Hi.

    Give this a try.
    Code:
    (read (strcat " " TUBE150X150X4.5 20.2 " "))
    Regards,
    Tharwat

  3. #3
    Senior Member
    Using
    AutoCAD 2007
    Join Date
    Dec 2009
    Posts
    152

    Default

    Quote Originally Posted by tharwat313 View Post
    Hi.

    Give this a try.
    Code:
    (read (strcat " " TUBE150X150X4.5 20.2 " "))
    Regards,
    Tharwat

    Not working.

  4. #4
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    Here it goes very well.
    load the file and type abc to start;
    Code:
    (defun c:abc (/ a b c d e f g tharwat pt)
    (setq a "TUBE"
          b "150"
          c "X"
          d "150"
          e "X"
          f "4.5"
          g "20.2")
    (setq tharwat (strcat "(" a b c d e f " " g ")"))
       (if (setq pt (getpoint "\nSpecify placement point: "))
        (entmake (list '(0 . "TEXT")
                       (cons 40 (getvar 'textsize))
                       (cons 10 (trans pt 1 0))
                       (cons 1 tharwat)
           ) ) )
      (princ)
    )
    The outcome is (TUBE150X150X4.5 20.2)
    Enjoy.
    Tharwat
    Last edited by Tharwat; 20th Jun 2010 at 09:52 am.

  5. #5
    Quantum Mechanic
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    10,417

    Default

    I think what you need is strcat chr(x) "TUBE150X150X4.5" "20.2" chr(y)

    The correct value for x as an example 13 is Carriage return 32 is space you can basicly replace any keyboard character with a number value I wrote years ago an asc lisp that gave me the number as I pressed a key.

    Big hints look for HELP asc & chr in lisp help

    Sorry could not find asc.lsp also known as asci key codes.

  6. #6
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    Quote Originally Posted by BIGAL View Post
    I think what you need is strcat chr(x) "TUBE150X150X4.5" "20.2" chr(y)

    The correct value for x as an example 13 is Carriage return 32 is space you can basicly replace any keyboard character with a number value I wrote years ago an asc lisp that gave me the number as I pressed a key.

    Big hints look for HELP asc & chr in lisp help

    Sorry could not find asc.lsp also known as asci key codes.
    Hi.
    If you would give us an example, that would be much better.....

    Tharwat

  7. #7
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    Hello muthu123
    Today is your lucky day man ... my ideas are burning up promptly today.
    Check this out, it is as best as the previous one.
    Code:
    (defun c:abc (/ a pt)
    (setq a "(TUBE150X150X4.5 20.2)")
       (if (setq pt (getpoint "\nSpecify placement point: "))
        (entmake (list '(0 . "TEXT")
                       (cons 40 (getvar 'textsize))
                       (cons 10 (trans pt 1 0))
                       (cons 1 a)
           ) ) )
      (princ "Cad Tutor Forum is the best")
    (princ))
    regards
    Tharwar

  8. #8
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    So finally.

    The main problem is within the function 'read' because it doesn't except decimal
    number or couldn't deal with it .

    Hope that was helpful and enough .

    Tharwat
    Syria

  9. #9
    Senior Member
    Computer Details
    VVA's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i5-2400
    RAM:
    8 Gb
    Graphics:
    Nvidia Quadro 600
    Primary Storage:
    Seagate 500 GB + WD 750 GB
    Monitor:
    Philips 27"
    Using
    AutoCAD 2013
    Join Date
    Dec 2006
    Location
    Minsk, Belarus
    Posts
    447

    Default

    Quote Originally Posted by tharwat313 View Post
    So finally.

    The main problem is within the function 'read' because it doesn't except decimal
    number or couldn't deal with it .

    Hope that was helpful and enough .

    Tharwat
    Syria
    so satisfied?
    Code:
    (read (strcat "(" "\"" "TUBE150X150X4.5" "\"" "20.2" ")"))
    return ("TUBE150X150X4.5" 20.2)

  10. #10
    Luminous Being Tharwat's Avatar
    Discipline
    Mechanical
    Tharwat's Discipline Details
    Occupation
    MEP AutoCAD Draughtsman
    Discipline
    Mechanical
    Details
    HVAC, Drainage, Water Supply, Fire Fighting and a little about Electricity.
    Using
    AutoCAD 2015
    Join Date
    Oct 2009
    Location
    Great Syria , Living in Abu Dhabi
    Posts
    6,159

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by VVA View Post
    so satisfied?
    Code:
    (read (strcat "(" "\"" "TUBE150X150X4.5" "\"" "20.2" ")"))
    return ("TUBE150X150X4.5" 20.2)
    It is differ than the required. try it with brackets ......

    I would like to see it come true .

Similar Threads

  1. "save" in the file "pull down menu" not working
    By kfarrar in forum Civil 3D & LDD
    Replies: 11
    Last Post: 25th Dec 2013, 10:22 am
  2. Replies: 1
    Last Post: 25th Nov 2009, 06:35 pm
  3. AcadMap3D 2010_freezes on "open" or "save" ...
    By Jest in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 8
    Last Post: 26th Aug 2009, 08:27 am
  4. "LINK template" icons "greyed out" -why?
    By Chrisjpritchard in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 2nd Mar 2007, 10:25 pm
  5. "Union" Meshes or "Slice" 3D Mesh
    By Peter31712 in forum AutoCAD 3D Modelling & Rendering
    Replies: 1
    Last Post: 29th Apr 2004, 11: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