+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Forum Newbie
    Discipline
    Landscape
    Using
    AutoCAD LT 2017
    Join Date
    Jan 2018
    Posts
    4

    Default Newbie question - how to modify existing code

    Registered forum members do not see this ad.

    Hi,

    I would like to move the decimal place in the coordinates 3 places to the left to convert from mm to m - e.g divide by 1000 - in the following code, for both X value and Y value. Have tried reading tutorials, but doesn't seem to work. Any help appreciated (e.g. divide the numbers that result from $(rtos,$(index,0,$(getvar,lastpoint)),2,2) in the following):

    ^C^C_id;\_-mtext;@;_h;$M=$(*,.25,$(getvar,ltscale));@1<-45;X=$(rtos,$(index,0,$(getvar,lastpoint)),2,2);Y= $(rtos,$(index,1,$(getvar,lastpoint)),2,2);;_move; _last;;@;\_qleader;$(getvar,lastpoint);

    Many thanks.

  2. #2
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO 64-bit
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x64
    CPU:
    Pentium(R) i5 4570 @ 3.2GHz
    RAM:
    8 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    2x ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2018
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    11,877

    Default

    I have moved your thread to the AutoCAD LT Forum.

    I do not believe AutoCAD LT can use any LISP. Looks like you are working on creating a Button Macro.

    It also helps to use Code Tags.

    [CODE]Your Code Here[/CODE] =
    Code:
    Your Code Here
    Last edited by SLW210; 5th Jan 2018 at 12:17 pm. Reason: Corrected Information
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



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

    Default

    Look at this example divide by 10 just add it in sequence.

    Code:
    $(/,$(getvar,viewsize),10))
    I know I had a run diesel form command line it may be at home or else would test.

    tested
    Code:
    X=$(rtos, $(/,$(getvar,viewsize),1000.0) ,2,2)
    Run diesel from command line

    Code:
    (defun C:DIESEL ( / dsl )
      (while (/= dsl "M=")
        (setq dsl (strcat "M=" (getstring T "\nDIESEL: ")))
        (princ (menucmd dsl))
      )
      (princ)
    )
    Last edited by BIGAL; 5th Jan 2018 at 10:23 am.
    A man who never made mistakes never made anything

  4. #4
    Forum Newbie
    Discipline
    Landscape
    Using
    AutoCAD LT 2017
    Join Date
    Jan 2018
    Posts
    4

    Default Thanks, one more adjustment...

    Hi,

    I should have said that I'm pasting this into the macro field when creating a custom command in autocad LT (CUI). It seems to work fine. There is something else I would like to modify about it though:

    The leader takes the default arrow style and size, is there a way to specify this in the code (I want circle with origin shown and size about 50) or to point it to a custom style within the dimstyles?

    My directors are not currently sure if they want mms or metres, so lets run with the original code:

    ^C^C_id;\_-mtext;@;_h;$M=$(*,.25,$(getvar,ltscale));@1<-45;X=$(rtos,$(index,0,$(getvar,lastpoint)),2,2);Y= $(rtos,$(index,1,$(getvar,lastpoint)),2,2);;_move; _last;;@;\_qleader;$(getvar,lastpoint);

    Many thanks.

  5. #5
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2018
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,086

    Default

    Unfortunately there is no way to bypass the leader dialogue in LT, and dialogues can't be navigated with a script or macro, there is no commandline alternative.
    I've just been down graded from 2012LT to full Autocad 2017. I WANT LT BACK

  6. #6
    Forum Newbie
    Discipline
    Landscape
    Using
    AutoCAD LT 2017
    Join Date
    Jan 2018
    Posts
    4

    Default

    Ok, thanks.

    One more question. In LT on Mac, is there a way to access this custom command from the command line? E.g. like the usual commands PL, RECTANG, DI, etc.

    Many thanks in advance.

  7. #7
    Forum Deity steven-g's Avatar
    Computer Details
    steven-g's Computer Details
    Operating System:
    Win 7
    Discipline
    Construction
    steven-g's Discipline Details
    Occupation
    Draughtsman
    Discipline
    Construction
    Details
    I work in the estimating department of a large building contractor.
    Using
    AutoCAD 2018
    Join Date
    May 2013
    Location
    An Englishman in Belgium
    Posts
    2,086

    Default

    If you mean your new macro, then I doubt it, I don't know anything about LT for MAC except it has quite a bit less functionality than LT, and in the windows LT version you cannot run a macro from the command line.
    I've just been down graded from 2012LT to full Autocad 2017. I WANT LT BACK

  8. #8
    Forum Newbie
    Discipline
    Landscape
    Using
    AutoCAD LT 2017
    Join Date
    Jan 2018
    Posts
    4

    Default

    Registered forum members do not see this ad.

    Decided to just apply a Mac system keyboard shortcut to the command. Thanks

Similar Threads

  1. Help to modify existing lisp
    By dnovember99 in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 30th Nov 2017, 01:15 am
  2. Modify Existing Lisp to include Z Values?
    By JQUAILE in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 28th Mar 2014, 02:55 pm
  3. Replies: 0
    Last Post: 23rd Nov 2011, 03:16 am
  4. I'm unable to modify an existing drawing
    By bosers83 in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 11th Jan 2011, 04:08 pm
  5. Modify Existing LISP - Lee Mac
    By AQucsaiJr in forum AutoLISP, Visual LISP & DCL
    Replies: 13
    Last Post: 26th Oct 2009, 04:20 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