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

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    Which parts specifically do you not understand?

    If you do not understand my explanations, I would expect you to ask questions for clarification, not bluntly dismiss the explanation out of hand.

    I'll choose to ignore the immature comment while you reconsider which one of us is asking for help.
    Ok my bad, my apologies for that ignorant comment.

    Basically what you're trying to say is if I put a number after
    Code:
    (strcat "X=" (rtos (car p)) "\\XY=" (rtos (cadr p)))
    Code:
    (strcat "X=4" (rtos (car p)) "\\XY=" (rtos (cadr p)))
    This should then change the 'gap' between each of the x and y coordinates?

    EDIT: No, it doesn't it just adds a number in front of the x and y coordinates.

    The luprec and And lunits just confuse me, I put a number e.g. 3/4 and it adds fractions to the end of the coordinates.

  2. #42
    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,709

    Default

    Quote Originally Posted by bharthts01 View Post
    Basically what you're trying to say is if I put a number after
    Code:
    (strcat "X=" (rtos (car p)) "\\XY=" (rtos (cadr p)))
    Code:
    (strcat "X=4" (rtos (car p)) "\\XY=" (rtos (cadr p)))
    This should then change the 'gap' between each of the x and y coordinates?

    EDIT: No, it doesn't it just adds a number in front of the x and y coordinates.

    The luprec and And lunits just confuse me, I put a number e.g. 3/4 and it adds fractions to the end of the coordinates.
    To explain further, the rtos function (as used in my code) converts the X & Y numerical coordinate values of the selected point into strings to be used with the DimOrdinate command.

    The rtos function takes the following format:
    Code:
    (rtos <number> <units> <precision>)
    If the units and precision parameters are not supplied, rtos will use the current values of the LUNITS and LUPREC System Variables.

    To use specific Units and Precision, supply the rtos function with the units and precision parameters, hence, in my code:

    Code:
    (strcat "X=" (rtos (car p)) "\\XY=" (rtos (cadr p)))
    becomes:

    Code:
    (strcat "X=" (rtos (car p) 2 0) "\\XY=" (rtos (cadr p) 2 0))
    Here, 2=decimal and 0=zero decimal places.

    The "\\X" part of the string:

    Code:
    (strcat "X=" (rtos (car p) 2 0) "\\XY=" (rtos (cadr p)2 0))
    forces the subsequent text ("Y=....") onto a new line beneath the dimordinate dimension line.

    Removing the "\\X" from the string will keep everything on the same line:

    Code:
    (strcat "X=" (rtos (car p) 2 0) " Y=" (rtos (cadr p) 2 0))
    Lee Mac Programming

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

    Just another Swamper

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

    Default

    Quote Originally Posted by Lee Mac View Post
    :

    Code:
    (strcat "X=" (rtos (car p) 2 0) " Y=" (rtos (cadr p) 2 0))

    I think I just about follow you on that one, I've done it so I've edited to the code out so it displays X and Y on the same line (like you've stated removal of "\\XY=" to just Y=.

    I've done all that but when it comes to running the lisp I get this error "malformed list on input". I'm going to assume this means I've entered the code wrong.


    Code:
    (defun c:dimo ( / p )
        (while (setq p (getpoint "\nSpecify Point <Exit>: "))
            (command "_.dimordinate" "_non" p "_T" (strcat "X=" (rtos (car p) 2 0) "Y=" (rtos (cadr p) 2 0)
        )
        (princ)
    )
    If it helps this is the new code, I've edited out the xy so it shows the coordinates on the same line

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

    Default

    I see I've sorted it now by simply adding 2 0 into the code it's changed it to 9 digits and put it on the same line.

  5. #45
    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,709

    Default

    Close...

    The malformed list on input indicates that you are missing one or more closing parentheses ")"

    You are also missing the pause for the final point, corrected:

    Code:
    (defun c:dimo ( / p )
        (while (setq p (getpoint "\nSpecify Point <Exit>: "))
            (command "_.dimordinate" "_non" p "_T" (strcat "X=" (rtos (car p) 2 0) " Y=" (rtos (cadr p) 2 0)) "\\")
        )
        (princ)
    )
    Lee Mac Programming

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

    Just another Swamper

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

    Default

    Wow thought I'd never understand this Java language stuff. Thanks for the help mate. Really appreciated.

  7. #47
    Full Member cadplayer's Avatar
    Computer Details
    cadplayer's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core CPU 3.4 GHz, 64bit system
    RAM:
    16GB RAM
    Graphics:
    NVIDIA GeForce GTX 400
    Using
    Civil 3D 2012
    Join Date
    May 2011
    Posts
    30

    Default

    Annother way to do your workset without any lisp to look for oportonities with blocks. It´s very easy to learn. You make a block with two attributes and than you marks text from attributes an put right button of mouse. You can read textfield in tab an choice it. Than you give a charakter for textobject... Take a look on Lynn Allen´s explanation she´s done it only with text but you can also do the same with a attribute. (http://www.youtube.com/watch?v=2cDal...eature=related).

    You have to marke a object in a block and give properties for x&y coordinates.
    Try it if you can´t understand Autolisp in the beginning.

    cheers Dirk

  8. #48
    Forum Newbie
    Using
    not applicable
    Join Date
    Jan 2013
    Posts
    4

    Default

    Hello
    I am a setting out engineer just getting into Autocad. I am able to scale and localize the drawings at the minute. I am now looking to id points and note the eastings and northings by the points, so that I can print it off to take out on site. The lisp program here, when I run it, only gives me 2 decimal places (10's of mm) where I need 3 decimal places (mm accuracy).
    Can anyone please change the code for 3 decimal places.

    I have found mulitleader type lisps that give me 3 decimal places. However for some reason the co-ords come up in a massive size.

  9. #49
    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,709

    Default

    Quote Originally Posted by JGC View Post
    The lisp program here, when I run it, only gives me 2 decimal places (10's of mm) where I need 3 decimal places (mm accuracy).
    Can anyone please change the code for 3 decimal places.
    Read this post:

    http://www.cadtutor.net/forum/showth...l=1#post491719
    Lee Mac Programming

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

    Just another Swamper

  10. #50
    Forum Newbie
    Using
    not applicable
    Join Date
    Jan 2013
    Posts
    4

    Default

    Registered forum members do not see this ad.

    I have had a look at the thread and then a look at the lisp code.

    I have changed "(defun go_ne ()(setvar "luprec" 2)" to "(defun go_ne ()(setvar "luprec" 3)" and this seems to work.

    I have seen your name on a couple of other threads I repled to yesterday. (I have found other multileader lisps that do the same thing, but the text comes out massive compared to the dwg.)

    Thankyou for your time.

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