+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Macro question?

  1. #1
    Forum Newbie
    Using
    AutoCAD LT 2013
    Join Date
    May 2012
    Posts
    3

    Default Macro question?

    Registered forum members do not see this ad.

    am having trouble writing a macro for the alignment of text to an existing line orientation, has anyone already done this by any chance?

  2. #2
    Senior Member Blackfish's Avatar
    Using
    AutoCAD LT 2012
    Join Date
    Apr 2012
    Posts
    182

    Default

    Quote Originally Posted by matloft View Post
    am having trouble writing a macro for the alignment of text to an existing line orientation, has anyone already done this by any chance?
    Can you post whatever you have written?
    There are guys they cannot resist to help you, but any initial effort's appreciated.
    LT is still AutoCAD

  3. #3
    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

    Your profile states that you are using LT; therefore I have to presume that you are talking about a macro for a toolbar button. I’m really not sure if you can achieve that – it is supposed to require a kind of calculation of the base line orientation, which I really don’t see how can be done in button’s macro without AutoLISP support.
    Regards,
    Mircea

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

  4. #4
    Senior Member Blackfish's Avatar
    Using
    AutoCAD LT 2012
    Join Date
    Apr 2012
    Posts
    182

    Default

    What is wrong with ALIGN command?
    Last edited by Blackfish; 31st May 2012 at 06:58 pm.
    LT is still AutoCAD

  5. #5
    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

    If you don't mind an interactive solution, then may check if this is useful to you.
    Regards,
    Mircea

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

  6. #6
    Senior Member Blackfish's Avatar
    Using
    AutoCAD LT 2012
    Join Date
    Apr 2012
    Posts
    182

    Default

    Quote Originally Posted by MSasu View Post
    If you don't mind an interactive solution, then may check if this is useful to you.
    That's interesting, but now you have standard ALIGN command in AutoCAD 2012LT or newer.
    However with single-line text when justified to left there is no second characteristic point you can select to align to the line...
    LT is still AutoCAD

  7. #7
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    Not sure if this works in LT UCS OB pick line do text UCS W make sure ortho is on. this will allow text at 0 90 etc to line. You can add a button or menu or macro to do UCS OB
    A man who never made mistakes never made anything

  8. #8
    Super Moderator fuccaro's Avatar
    Using
    AutoCAD 2006
    Join Date
    Nov 2002
    Location
    Romania, Marosvasarhely
    Posts
    3,540

    Default

    Quote Originally Posted by BIGAL View Post
    Not sure if this works in LT UCS OB pick line do text UCS W make sure ortho is on. this will allow text at 0 90 etc to line. You can add a button or menu or macro to do UCS OB
    That's fine if the current ucs is W. I think it should return to the previous one, UCS P would be a better choise.
    It's nice to be nice, but sometimes is nicer to be evil!.
    Tip: Please do not PM or email me with CAD questions - use the forums, you'll get an answer sooner.

  9. #9
    Senior Member Blackfish's Avatar
    Using
    AutoCAD LT 2012
    Join Date
    Apr 2012
    Posts
    182

    Default

    Quote Originally Posted by BIGAL View Post
    Not sure if this works in LT UCS OB pick line do text UCS W make sure ortho is on. this will allow text at 0 90 etc to line. You can add a button or menu or macro to do UCS OB
    BIGAL, thank you for the great idea: UCS OB! I didn't know how to get an angle from single-line text, because there is only one insertion point, and with Diesel and macro you are very limited, but as always we should try...

    I did it the other way, because I don't understand what do you mean by 'do text UCS W'. Would be nice to just select line instead of picking two points, but I have no idea how to improve the below code.


    Quote Originally Posted by fuccaro View Post
    That's fine if the current ucs is W. I think it should return to the previous one, UCS P would be a better choise.
    So, I did.


    Code:
    ^C^C_ucs;n;ob;\^C^C_move;@;;0,0;\^C^C_rotate;p;;@;\^C^C_ucs;p;
    Maybe something could be better but as a start I'm quite happy


    PS. Almost as usually no OP's cooperation
    Last edited by Blackfish; 4th Jun 2012 at 06:31 pm. Reason: better revised code
    LT is still AutoCAD

  10. #10
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    Registered forum members do not see this ad.

    I thought you were trying to add text but to an existing line for orientation rather than alter existing.

    Any way the Ucs W, User Co-ordinate System WORLD, mosts times when you start a dwg you are in the "world" setting, if you crash your macro you may need UCS W but UCS P "previous" is a good way to go if your playing with different ucs's. Also another quickie for lots of text "UCS Ob plan" pick all text use "modify" set angle to 0 then "UCS P plan" bit quicker maybe than typing 47d23'35" after you have found out the correct angle.
    A man who never made mistakes never made anything

Similar Threads

  1. Quick Basic Macro question
    By addesigns in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 8
    Last Post: 13th Feb 2012, 01:30 pm
  2. Question about Macro and VBA
    By john7911 in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 8
    Last Post: 20th Dec 2011, 02:09 pm
  3. noob macro question
    By The Stig in forum The CUI, Hatches, Linetypes, Scripts & Macros
    Replies: 7
    Last Post: 10th May 2011, 04:24 am
  4. quick scale question with lisp or macro
    By chelsea1307 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 3rd Mar 2009, 07:49 pm
  5. Macro Question
    By matrix in forum AutoCAD General
    Replies: 1
    Last Post: 13th Mar 2006, 12:10 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