+ Reply to Thread
Page 1 of 5 1 2 3 ... LastLast
Results 1 to 10 of 50
  1. #1
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Aug 2012
    Posts
    34

    Default How to create a lisp program displaying coordinates

    Registered forum members do not see this ad.

    Hi Guys,

    I'm fairly new to this 'lisp' program. I'm a trainee setting out engineer and have a question.

    How do I display both eastings and northings coordinates on one line?
    My senior engineer has it on his Auto CAD but got it done from somebody else and he doesn't know how to do it.

    See Image - Shows coordinates X and Y



    This is how it should be - Please note I typed them coordinates in myself



    Any help would be greatly appreciated

    Taj.

  2. #2
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,000

    Default

    I believe you should provide more details on your issue. Are you looking to modify an existing routine? Then you should post at least an excerpt from it – the part that manages those coordinates insertion.
    Basically, those coordinates should be strings, so the function you were looking for is STRCAT.
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

  3. #3
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Aug 2012
    Posts
    34

    Default

    Quote Originally Posted by MSasu View Post
    I believe you should provide more details on your issue. Are you looking to modify an existing routine? Then you should post at least an excerpt from it – the part that manages those coordinates insertion.
    Basically, those coordinates should be strings, so the function you were looking for is STRCAT.
    This is how I get coordinates, dimensions > ordinates. This displays the eastings and northings of the point.



    This looks very messy to me, all I want to know is how do I make it so instead of it displaying it like above, which looks very messy and can get quite confusing.



    Does that make sense? Sorry, not very good on CAD

  4. #4
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Enterprise 64 bit
    Computer:
    Dell Precision M4500
    CPU:
    Intel Core i5 2.40GHz
    RAM:
    8GB
    Graphics:
    NVIDIA Quadro FX 880M
    Primary Storage:
    280 GB
    Monitor:
    2 x Samsung SyncMaster 2443 24''
    Using
    AutoCAD 2012
    Join Date
    Nov 2006
    Location
    Sthlm, Sweden
    Posts
    4,595

    Default

    To display coordinates like that you are most likely using a Lisp of some sort, a Lisp is a custom-made command that someone have created for you sometime in the past. If the peeps here don't get to look at the routine behind the command, there is not much they can help you with - besides writing a brand new routine which is unneccesary since you have one that works almost as you want.
    Life doesn't suck, although we all go through periods when it may be easier to think that, than to discern the solution to whatever problem is the most formidable
    at the moment in one's personal UCS.
    Go to PLAN view instead. - Dadgad

  5. #5
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Aug 2012
    Posts
    34

    Default

    Quote Originally Posted by Tiger View Post
    To display coordinates like that you are most likely using a Lisp of some sort, a Lisp is a custom-made command that someone have created for you sometime in the past. If the peeps here don't get to look at the routine behind the command, there is not much they can help you with - besides writing a brand new routine which is unneccesary since you have one that works almost as you want.
    I think I should reword the thread,

    I know in order for me to view coordinates in the second image I have to use a lisp program.
    The question is, how do I do this?

    I see where I'm creating confusion though.

  6. #6
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Enterprise 64 bit
    Computer:
    Dell Precision M4500
    CPU:
    Intel Core i5 2.40GHz
    RAM:
    8GB
    Graphics:
    NVIDIA Quadro FX 880M
    Primary Storage:
    280 GB
    Monitor:
    2 x Samsung SyncMaster 2443 24''
    Using
    AutoCAD 2012
    Join Date
    Nov 2006
    Location
    Sthlm, Sweden
    Posts
    4,595

    Default

    Somewhere in the Lisp-routine there is code that determines how the text is displayed - if you can post the actual lisp routine then it is very likely that you can get help in changing the code.
    Life doesn't suck, although we all go through periods when it may be easier to think that, than to discern the solution to whatever problem is the most formidable
    at the moment in one's personal UCS.
    Go to PLAN view instead. - Dadgad

  7. #7
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Aug 2012
    Posts
    34

    Default

    Code:
    (defun c:ne ()(setvar "osmode" 1)
    (setq ne1 (getpoint"\nPick point..."))
    (setvar "osmode" 0)
    (if (/= ne1 nil)(go_ne)(princ"\nInvalid Location !"))
    (princ)
    )
    (setq tx-ht 0.5)
    (defun go_ne ()(setvar "luprec" 2)
    (setq prmt (strcat "Enter TEXT HEIGHT<"(rtos tx-ht)">: "))
    (princ prmt)
    (setq x-ht (getreal))(if (= x-ht nil)(setq x-ht tx-ht))
    (setq tx-ht x-ht)
    (setq e-x (car ne1))(setq xx (rtos e-x))
    (setq n-y (cadr ne1))(setq yy (rtos n-y))
    (tx-f)
    )
    (defun tx-f ()
    (setq vx (strcat " E " xx))
    (setq vy (strcat " N " yy))
    (command "text" "j" "ml" ne1 x-ht "0" vy)
    (command "text" "j" "ml" ne1 x-ht "90" vx)
    )
    This is what I've been told would work.

  8. #8
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Aug 2012
    Posts
    34

    Default

    Also how do I implement this? Make it actually work? I've saved the program but when it comes to opening the program it never works.
    I type in (load "myprog") and it comes up with "error load failed".

  9. #9
    Super Moderator Tiger's Avatar
    Computer Details
    Tiger's Computer Details
    Operating System:
    Windows 7 Enterprise 64 bit
    Computer:
    Dell Precision M4500
    CPU:
    Intel Core i5 2.40GHz
    RAM:
    8GB
    Graphics:
    NVIDIA Quadro FX 880M
    Primary Storage:
    280 GB
    Monitor:
    2 x Samsung SyncMaster 2443 24''
    Using
    AutoCAD 2012
    Join Date
    Nov 2006
    Location
    Sthlm, Sweden
    Posts
    4,595

    Default

    I can't help you with the re-write of the program, but I can give you a handy link on How To Use A Lisp-Routine.
    Life doesn't suck, although we all go through periods when it may be easier to think that, than to discern the solution to whatever problem is the most formidable
    at the moment in one's personal UCS.
    Go to PLAN view instead. - Dadgad

  10. #10
    Forum Deity MSasu's Avatar
    Discipline
    Construction
    MSasu's Discipline Details
    Occupation
    engineer
    Discipline
    Construction
    Details
    AutoLISP programmer
    Using
    AutoCAD 2013
    Join Date
    Mar 2009
    Location
    Brasov, Romania
    Posts
    3,000

    Default

    Registered forum members do not see this ad.

    This is because AutoCAD isn't able to locate that file - you should either add container folder in Options --> Files --> Support Files Search Path list or input the loading path (please note the double back-slashes):
    Code:
    (load "C:\\MyLispTool\\myprog")
    Regards,
    Mircea

    AutoCAD's happy user equation: FILEDIA + PICKADD² + PICKFIRST = 3

Similar Threads

  1. How to create .NET program that automate AutoCAD
    By oldguy in forum .NET, ObjectARX & VBA
    Replies: 4
    Last Post: 29th Sep 2011, 12:38 am
  2. VBA Displaying Pick point coordinates in UserForm Text box
    By scubastu in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 18th Nov 2009, 05:03 am
  3. How to create a irregular solid from coordinates and know its volume.??????
    By jcaz15 in forum AutoCAD 3D Modelling & Rendering
    Replies: 4
    Last Post: 17th Oct 2008, 05:59 am
  4. Lisp Routine For Displaying Attributes
    By stephencurran in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 30th Jul 2008, 06:00 pm
  5. Lisp Routine not displaying until a regen
    By bill4227 in forum AutoCAD Drawing Management & Output
    Replies: 5
    Last Post: 27th Feb 2007, 08:07 am

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