Jump to content

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


lucas3

Recommended Posts

  • Replies 26
  • Created
  • Last Reply

Top Posters In This Topic

  • lucas3

    13

  • ReMark

    6

  • Tharwat

    4

  • MSasu

    2

Top Posters In This Topic

Posted Images

I don't know how to make that overrides with lisp although I think it is a matter of error or irregular process that may take a place in any drawing with any dimension style.

Link to comment
Share on other sites

I don't know how to make that overrides with lisp although I think it is a matter of error or irregular process that may take a place in any drawing with any dimension style.

 

(defun mksubdimsty (name mod lst / dims nname)
 (setq        dims (vla-get-dimstyles
              (vla-get-activedocument (vlax-get-acad-object))
            )
 )
 (if (and (tblsearch "dimstyle" name)
          (setq nname (strcat name mod))
          (not (tblsearch "dimstyle" nname))
     )
   (progn
     (vla-put-activedimstyle
       (vla-get-activedocument (vlax-get-acad-object))
       (vla-item dims name)
     )
     (vl-cmdf ".dimstyle" "s" nname)
     (if lst
       (progn
         (mapcar '(lambda (x) (apply 'setvar x)) lst)
         (vl-cmdf ".dimstyle"  "s" nname  "y")
       )
     )
   )
 )
 (princ)
)

 

(mksubdimsty
 "custom"
 "$3"
 '(("DIMTOH" 1) ("DIMTIH" 0))
)

 

This function?

Edited by lucas3
Link to comment
Share on other sites

:)

 

(vl-load-com)  
(defun mksubdimsty (name mod lst / dims nname)
 (setq        dims (vla-get-dimstyles
              (vla-get-activedocument (vlax-get-acad-object))
            )
 )
 (if (and (tblsearch "dimstyle" name)
          (setq nname (strcat name mod))
          (not (tblsearch "dimstyle" nname))
     )
   (progn
     (vla-put-activedimstyle
       (vla-get-activedocument (vlax-get-acad-object))
       (vla-item dims name)
     )
     (vl-cmdf ".dimstyle" "s" nname)
     (if lst
       (progn
         (mapcar '(lambda (x) (apply 'setvar x)) lst)
         (vl-cmdf ".dimstyle"  "s" nname  "y")
       )
     )
   )
 )
 (princ)
)
(defun Text+Dim nil
 ;; Tharwat 17. Jan. 2014     ;;
 (if (not (tblsearch "STYLE" "ggg"))
   (entmakex '((0 . "STYLE")
               (100 . "AcDbSymbolTableRecord")
               (100 . "AcDbTextStyleTableRecord")
               (2 . "ggg")
               (40 . 0.)
               (41 . 1.)
               (42 . 1.0)
               (50 . 0.)
               (70 . 0)
               (71 . 0)
               (3 . "gdt.shx")
               (4 . "gbcbig.shx")
              )
   )
 )
 ;;                            ;;
 (if (and (not (tblsearch "DIMSTYLE" "custom"))
          (tblsearch "STYLE" "ggg")
     )
   (entmakex (list '(0 . "DIMSTYLE")
                   '(100 . "AcDbSymbolTableRecord")
                   '(100 . "AcDbDimStyleTableRecord")
                   '(2 . "custom")
                   '(70 . 0)
                   '(41 . 2.5)
                   '(42 . 2.0)
                   '(43 . 7.0)
                   '(44 . 2.25)
                   '(73 . 0)
                   '(77 . 1)
                   '(78 . 
                   '(140 . 2.5)
                   '(141 . 2.5)
                   '(171 . 3)
                   '(172 . 1)
                   '(271 . 2)
                   '(272 . 2)
                   '(274 . 3)
                   '(278 . 44)
                   '(283 . 0)
                   '(284 . 
                   (cons 340 (tblobjname "STYLE" "ggg"))
             )
   )
 )
(mksubdimsty
 "custom"
 "$3"
 '(("DIMTOH" 1) ("DIMTIH" 0))
)
 (princ)
)



Edited by lucas3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...