Jump to content

Recommended Posts

Posted
Thanks Buzzard, maybe someone else has some ideas....

 

woodman78,

 

I took a shot at writing the code to allow for Closed Filled arrows by creating a custom block. It seems to work well with all the supplied arguments so far. I also added a layer function to. The font style is also in the code. Please note to save yourself a lot of headaches, When editing this code do small portions and test. Do not get carried away yourself. Take it a little at a time. I hope this will be helpful to you. The code can have a dialog added if you wish to supply the arguments with values as well to make it more flexible.

 

I will be working on a dialog driven model myself, But I will not be posting it anytime soon. For now this should give you some idea.

 

Good Luck,

 

;;;/////////////////////////////////////////////////////////
;
; DimStyle Lisp
;
(defun C:DSTYLE ()
 (DSTYLE_STYLE "Romans" 1.0 0.0 "romans.shx" "")
 (DSTYLE_LAYER "A-ANNO-DIMS" "Continuous" 2 18)
 (DSTYLE_ARROW "Closed Filled" (list 0.0 0.0 0.0)(list -1.0 0.166667 0.0)(list -1.0 -0.166667 0.0)(list 0.0 0.0 0.0)(list 0.0 0.0 0.0))
 (DSTYLE_DIMSTYLE "1ft." 1.0 "Closed Filled" "Romans")
 (princ))
;
;;;/////////////////////////////////////////////////////////
;
; Font Style Create
;
(defun DSTYLE_STYLE (FSTY$ TWF# TOA# PFN$ BFN$)
 (if (null (tblsearch "style" FSTY$))
   (progn
     (entmake
       (list
         (cons 0   "STYLE")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbTextStyleTableRecord")
         (cons 2    FSTY$)
         (cons 70   0)
         (cons 40   0)
         (cons 41   TWF#)
         (cons 50   TOA#)
         (cons 3    PFN$)
         (cons 4    BFN$)
       )
     )
   )
 )
 (princ))
;
;;;/////////////////////////////////////////////////////////
;
; Layer Create
;
(defun DSTYLE_LAYER (LNAM$ LTYP$ LCLR# LWGT#)
 (if (null (tblsearch "layer" LNAM$))
   (progn
     (entmake
       (list
         (cons 0   "LAYER")
         (cons 100 "AcDbSymbolTableRecord")
         (cons 100 "AcDbLayerTableRecord")
         (cons 2    LNAM$)
         (cons 6    LTYP$)
         (cons 62   LCLR#)
         (cons 70   0)
         (cons 290  1)
         (cons 370  LWGT#)
       )
     )
   )
 )
 (princ))
;
;;;/////////////////////////////////////////////////////////
;
; Arrowhead Block Create ~ (Closed Filled)
;
(defun DSTYLE_ARROW (BNAM$ INPT# PT01# PT02# PT03# PT04#)
 (if (null (tblsearch "block" BNAM$))
   (progn
     (entmake
       (list
         (cons 0   "block")
         (cons 2    BNAM$)
         (cons 10   INPT#)
         (cons 70   2)
       )
     )
     (entmake
       (list
         (cons 0   "SOLID")
         (cons 100 "AcDbEntity")
         (cons 67   0)
         (cons 410 "Model")
         (cons 8   "0")
         (cons 62   1)
         (cons 100 "AcDbTrace")
         (cons 10   PT01#)
         (cons 11   PT02#)
         (cons 12   PT03#)
         (cons 13   PT04#)
         (cons 39   0.0)
       )
     )
     (entmake
       (list
         (cons 0   "endblk")
       )
     )
   )
 )
 (princ))
;
;;;/////////////////////////////////////////////////////////
;
; DimStyle Create
;
(defun DSTYLE_DIMSTYLE (DSTY$ DSCL# AH$ FSTY$)
 (if (null (tblsearch "dimstyle" DSTY$))
   (progn
     (entmake
       (list
  (cons 0 "DIMSTYLE")                                           ; Entity Type
  (cons 100 "AcDbSymbolTableRecord")                            ; Subclass marker
  (cons 100 "AcDbDimStyleTableRecord")                          ; Subclass marker
  (cons 2 DSTY$)                                                ; Dimstyle name
  (cons 70 0)                                                   ; Standard flag value
  (cons 3 "")                                                   ; DIMPOST
  (cons 4 "")                                                   ; DIMAPOST
  (cons 5  AH$)                                                 ; DIMBLK
  (cons 6  AH$)                                                 ; DIMBLK1
  (cons 7  AH$)                                                 ; DIMBLK2
  (cons 40 DSCL#)                                               ; DIMSCALE
  (cons 41 0.0937)                                              ; DIMASZ
  (cons 42 0.0937)                                              ; DIMEXO
  (cons 43 0.38)                                                ; DIMDLI
  (cons 44 0.0625)                                              ; DIMEXE
  (cons 45 0.0)                                                 ; DIMRND
  (cons 46 0.0625)                                              ; DIMDLE
  (cons 47 0.0)                                                 ; DIMTP
  (cons 48 0.0)                                                 ; DIMTM
  (cons 140 0.0937)                                             ; DIMTXT
  (cons 141 0.09)                                               ; DIMCEN
  (cons 142 0.0)                                                ; DIMTSZ
  (cons 143 25.4)                                               ; DIMALTF
  (cons 144 1.0)                                                ; DIMLFAC
  (cons 145 0.0)                                                ; DIMTVP
  (cons 146 1.0)                                                ; DIMTFAC
  (cons 147 0.0625)                                             ; DIMGAP
  (cons 71 0)                                                   ; DIMTOL
  (cons 72 0)                                                   ; DIMLIM
  (cons 73 0)                                                   ; DIMTIH
  (cons 74 0)                                                   ; DIMTOH
  (cons 75 0)                                                   ; DIMSE1
  (cons 76 0)                                                   ; DIMSE2
  (cons 77 0)                                                   ; DIMTAD
  (cons 78 3)                                                   ; DIMZIM
  (cons 170 0)                                                  ; DIMALT
  (cons 171 2)                                                  ; DIMALTD
  (cons 172 0)                                                  ; DIMTOFL
  (cons 173 0)                                                  ; DIMSAH
  (cons 174 0)                                                  ; DIMTIX
  (cons 175 0)                                                  ; DIMSOXD
  (cons 176 1)                                                  ; DIMCLRD
  (cons 177 1)                                                  ; DIMCLRE
  (cons 178 2)                                                  ; DIMCRRT
  (cons 270 4)                                                  ; DIMUNIT
  (cons 271 4)                                                  ; DIMDEC
  (cons 272 4)                                                  ; DIMTDEC
  (cons 273 2)                                                  ; DIMALTU
  (cons 274 2)                                                  ; DIMALTTD
  (cons 275 0)                                                  ; DIMAUNIT
  (cons 276 2)                                                  ; DIMFRAC
  (cons 277 4)                                                  ; DIMLUNIT
  (cons 279 2)                                                  ; DIMTMOVE
  (cons 280 0)                                                  ; DIMJUST
  (cons 281 0)                                                  ; DIMSD1
  (cons 282 0)                                                  ; DIMSD2
  (cons 283 1)                                                  ; DIMTOLJ
  (cons 284 0)                                                  ; DIMTZIN
  (cons 285 0)                                                  ; DIMALTZ
  (cons 286 0)                                                  ; DIMALTTZ
  (cons 287 5)                                                  ; DIMFIT
  (cons 288 0)                                                  ; DIMUPT
  (cons 340 (tblobjname "style" FSTY$))                         ; DIMTXSTY	
  (cons 342 (cdr (assoc 330 (entget (tblobjname "block" AH$))))); DIMLDRBLK
  (cons 343 (cdr (assoc 330 (entget (tblobjname "block" AH$))))); DIMLDRBLK1
  (cons 344 (cdr (assoc 330 (entget (tblobjname "block" AH$))))); DIMLDRBLK2
       )
     )
   )
 )
 (command "._-dimstyle" "_restore" DSTY$)                              ; Set dimstyle current
 (alert (strcat "\nThe current DimStyle name is "DSTY$"."
                "\nThe current DimScale set to "(rtos DSCL# 2 0)"."))
)
;
;;;/////////////////////////////////////////////////////////

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    10

  • woodman78

    9

  • TimSpangler

    3

  • Lee Mac

    1

Posted

Thanks Buzzard,

 

That's great. It worked a treat.

Posted
Thanks Buzzard,

 

That's great. It worked a treat.

Thats good to hear. Use it as is or just take what you need from it.

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