+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 27
  1. #1
    Senior Member lucas3's Avatar
    Computer Details
    lucas3's Computer Details
    Operating System:
    win7
    Motherboard:
    intel z87
    CPU:
    intel i7 4770
    RAM:
    8G
    Graphics:
    Quadro FX1800
    Primary Storage:
    SSD 120G
    Secondary Storage:
    500g
    Monitor:
    19
    Using
    AutoCAD 2012
    Join Date
    Dec 2013
    Location
    Taiwan
    Posts
    190

    Default Need help !Use lisp Create text style & dimension style.

    Registered forum members do not see this ad.

    Hey guys,
    I want use lisp to create a new Text style and a Dimension style,details as follows:
    1.Create a text style with name “ggg"
    font : gdt.shx ,big font : gbcbig.shx

    0.jpg

    2.Create Dimension style with name "custom"

    1.jpg

    2.1 Baseline spacing : 7 ,Extend beyond dim lines: 2.25, Offset from origin :2
    2.jpg

    2.2 Text syle :ggg ,Text height: 2.5
    3.jpg

    2.3 Create a Child style as diameter
    4.jpg

    2.4 Text alignment set to ISOstandard
    5.jpg

    The job is finally done.
    6.jpg

    please help me ! thanks very much! I'm overwhelmed with gratitude

  2. #2
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,357

    Default

    Why bother? Create the new dim style (really, how long does it take?) then drag and drop it onto a custom tool palette. One and done. Same for the text style.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  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
    4,008

    Default

    If you intend to use this in new drawings only (that it, not to adjust an existing drawing), then setting up a template with those will be an alternative solution.
    Regards,
    Mircea

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

  4. #4
    Senior Member lucas3's Avatar
    Computer Details
    lucas3's Computer Details
    Operating System:
    win7
    Motherboard:
    intel z87
    CPU:
    intel i7 4770
    RAM:
    8G
    Graphics:
    Quadro FX1800
    Primary Storage:
    SSD 120G
    Secondary Storage:
    500g
    Monitor:
    19
    Using
    AutoCAD 2012
    Join Date
    Dec 2013
    Location
    Taiwan
    Posts
    190

    Default

    Quote Originally Posted by ReMark View Post
    Why bother? Create the new dim style (really, how long does it take?) then drag and drop it onto a custom tool palette. One and done. Same for the text style.
    This is just one part of the program, I want make a autodim lisp ,Must use this text style & dim style

  5. #5
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,357

    Default

    Then do as previously suggested and make the styles part of your template.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  6. #6
    Senior Member lucas3's Avatar
    Computer Details
    lucas3's Computer Details
    Operating System:
    win7
    Motherboard:
    intel z87
    CPU:
    intel i7 4770
    RAM:
    8G
    Graphics:
    Quadro FX1800
    Primary Storage:
    SSD 120G
    Secondary Storage:
    500g
    Monitor:
    19
    Using
    AutoCAD 2012
    Join Date
    Dec 2013
    Location
    Taiwan
    Posts
    190

    Default

    Quote Originally Posted by MSasu View Post
    If you intend to use this in new drawings only (that it, not to adjust an existing drawing), then setting up a template with those will be an alternative solution.
    Hi ,MSasu ,If you have extra time, or very boring,please help me! I'm overwhelmed with gratitude

  7. #7
    Quantum Mechanic ReMark's Avatar
    Computer Details
    ReMark's Computer Details
    Operating System:
    Windows 7 Pro 64-bit
    Computer:
    Thinkmate
    Motherboard:
    Intel DX58SO2 LGA1366 X58
    CPU:
    Intel i7-960 Quad-core 3.20GHz 8MB cache
    RAM:
    12GB (3x4GB) PC3-106000 DDR3
    Graphics:
    nVidia Quadro K4200, 4GB GDDR5
    Primary Storage:
    150GB Velocipraptor 10,000 rpm
    Secondary Storage:
    none
    Monitor:
    Dell P24LLH - 24" wide screen LCD
    Discipline
    See details...
    ReMark's Discipline Details
    Occupation
    CAD Draftsman/Designer...chemical manufacturing.
    Discipline
    See details below.
    Details
    I work for a specialty chemical manufacturer. I do a little bit of everything from P&IDs to civil to architectural and structural.
    Using
    AutoCAD 2018
    Join Date
    Nov 2005
    Location
    Norwalk, CT USofA
    Posts
    46,357

    Default

    Let's say you create a lisp routine to do both. You then use it for the first time in a drawing. From there on out every time you need those styles they are available via the Design Center to drag and drop into a new drawing or like I previously mentioned you place them on a custom tool palette.
    "I have only come here seeking knowledge. Things they wouldn't teach me of in college." The Police

    Eat brains...gain more knowledge!

    I'm now a full member of the Society for the Promotion of Mediocrity in CAD. Standards? We don't need no stinkin' standards! Take whatever advice I offer and do the opposite.

  8. #8
    Senior Member lucas3's Avatar
    Computer Details
    lucas3's Computer Details
    Operating System:
    win7
    Motherboard:
    intel z87
    CPU:
    intel i7 4770
    RAM:
    8G
    Graphics:
    Quadro FX1800
    Primary Storage:
    SSD 120G
    Secondary Storage:
    500g
    Monitor:
    19
    Using
    AutoCAD 2012
    Join Date
    Dec 2013
    Location
    Taiwan
    Posts
    190

    Default

    Code:
    (command ".-style" "Gdt" "gdt.shx,gbcbig.shx" 0 1.0 0 "n" "n" "n")
    (defun MkDimStyleFrom (OldName NewName / dims ndim)
      (setq dims (vla-get-dimstyles
            (vla-get-activedocument (vlax-get-acad-object))
          )
      )
      (if (tblsearch "dimstyle" oldname)
        (progn
          (if (not (tblsearch "DimStyle" newName))
     (setq ndim (vla-add dims newName))
          )
          (vla-copyfrom (vla-item dims oldname) ndim)
          (vla-put-activedimstyle dims ndim)
        )
      )
    )
    ;;$2 augular dimensions,$3 diameter dimensions,$4 radius dimensions,$6  ordinate dimensions 
    (defun mksubdimsty (name mod / dims)
      (setq dims (vla-get-dimstyles
            (vla-get-activedocument (vlax-get-acad-object))
          )
      )
      (if (not (tblsearch "dimstyle" name))
        (progn
          (vla-put-activedocument dims (vla-item dims name))
          (vl-cmdf ".dimstyle" "s" (strcat (getvar "dimstyle") mod))
        )
      )
      (princ)
    )
    This code is from "http://bbs.xdcad.net/thread-672496-1-1.html" author is st788796

    I don't know how to use Custom Functions

  9. #9
    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
    4,008

    Default

    Quote Originally Posted by lucas3 View Post
    Hi ,MSasu ,If you have extra time, or very boring,please help me! I'm overwhelmed with gratitude
    Sorry, I will not create a template for you since is very easy to do it by yourself - just do the settings you were looking for (not only the styles, but everything you will like to have available to start a new drawing) and save it as Template file (DWT). AutoCAD will point automatically to template folder; chouse a relevant name. Don't forget to make a back-up copy.
    May want also to point the NEW command to this template (in Options --> Files --> Template Setting --> Default Template File Name for QNEW).
    Regards,
    Mircea

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

  10. #10
    Senior Member lucas3's Avatar
    Computer Details
    lucas3's Computer Details
    Operating System:
    win7
    Motherboard:
    intel z87
    CPU:
    intel i7 4770
    RAM:
    8G
    Graphics:
    Quadro FX1800
    Primary Storage:
    SSD 120G
    Secondary Storage:
    500g
    Monitor:
    19
    Using
    AutoCAD 2012
    Join Date
    Dec 2013
    Location
    Taiwan
    Posts
    190

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by MSasu View Post
    Sorry, I will not create a template for you since is very easy to do it by yourself - just do the settings you were looking for (not only the styles, but everything you will like to have available to start a new drawing) and save it as Template file (DWT). AutoCAD will point automatically to template folder; chouse a relevant name. Don't forget to make a back-up copy.
    May want also to point the NEW command to this template (in Options --> Files --> Template Setting --> Default Template File Name for QNEW).
    I don't want a template,I need one lisp !

Similar Threads

  1. Replies: 1
    Last Post: 15th Nov 2012, 12:56 pm
  2. How to create a text style for a dimension
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 6th Aug 2011, 05:30 pm
  3. Dimnsion style changes without dimension style being changed
    By Epicurwin in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 5
    Last Post: 27th May 2011, 01:52 am
  4. dimension style create (plz chk my new lisp & how to improve)
    By autolisp in forum AutoLISP, Visual LISP & DCL
    Replies: 37
    Last Post: 31st Jul 2010, 08:01 am
  5. Tutorial: Create an architectural dimension style
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 21st Jan 2007, 03:12 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