Results 1 to 3 of 3

Thread: Create dimension style using entmakex and modify it with entmod

  1. #1
    Active Member
    Join Date
    2012-06
    Posts
    96
    Login to Give a bone
    0

    Default Create dimension style using entmakex and modify it with entmod

    Can someone please help me figure out how can I update the visual appearance of my existing dimensions after creating a dimension using entmakex.

    Let me explain below:

    I create a dimension lets call it "XYZ" using ENTMAKEX function. (Now if there is no XYZ dimension present in the drawing, the entmakex function creates one)

    If there is a "XYZ" dimension in the drawing, the updated "XYZ" dimension created by ENTMAKEX doesn't update the existing one. I thought that maybe using the ENTMOD, and updating the dimensions made by ENTMAKEX but that doesn't work.

    Can someone help me figure out, how to update the existing "XYZ" dimension in the drawing with a new "XYZ" dimension create by ENTMAKEX

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: Create dimension style using entmakex and modify it with entmod

    Please post your code; it would make it easier for others to help you.

    Cheers
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Active Member
    Join Date
    2012-06
    Posts
    96
    Login to Give a bone
    0

    Default Re: Create dimension style using entmakex and modify it with entmod

    Code:
    (defun C:MM4Dimension( / )
    
      (progn
        (setq Dim_Name 				"MM4 Duct"
    	  Arrow_Size 				3.75
    	  Center_Mark_Size			0.0625
    	  Decimal_Places			2
    	  Dimension_Line_Spacing		8.5
    	  Extension_Above_Dimension_Line	2
    	  Extension_Line_Origin_Offset		2
    	  Gap_From_dimension_Line_to_Text	1.25
    	  Tolerance_Decimal_places		2
    	  Text_Movement				0
    	  Text_Name				"MM4"
    	  Text_Font				"romans.shx"
    	  Text_Height 				3.75))
      
    
    ; CHECK FOR THE DIMSTYLE AND IF NOT THERE CREATE IT
      (if (tblsearch "dimstyle" Dim_Name)()
        (progn
          (setq mm4_duct_dimension_code
    	     (entmakex
    	       (list
    		 (cons 0 "DIMSTYLE"); Table
    		 (cons 100 "AcDbSymbolTableRecord"); Subclass marker
    		 (cons 100 "AcDbDimStyleTableRecord"); Subclass marker
    		 (cons 2 Dim_Name); Dimstyle name
    		 (cons 70 0); Standard flag
    		 (cons 3 ""); DIMPOST
    		 (cons 4 ""); DIMAPOST
    		 ;(cons 5 "Oblique"); DIMBLK
    		 ;(cons 6 "ClosedFilled"); DIMBLK1
    		 ;(cons 7 "ClosedFilled"); DIMBLK2
    		 (cons 40 1.0000); DIMSCALE
    		 (cons 41 Arrow_Size); DIMASZ
    		 (cons 42 Extension_Line_Origin_Offset); DIMEXO
    		 (cons 43 Dimension_Line_Spacing); DIMDLI
    		 (cons 44 Extension_Above_Dimension_Line); DIMEXE
    		 (cons 45 0.0); DIMRND
    		 (cons 46 0.0); DIMDLE
    		 (cons 47 0.0); DIMTP
    		 (cons 48 0.0); DIMTM
    		 (cons 140 Text_Height); DIMTXT
    		 (cons 141 Center_Mark_Size); DIMCEN
    		 (cons 142 0.0); DIMTSZ
    		 (cons 143 25.4); DIMALTF
    		 (cons 144 1.0); DIMLFAC
    		 (cons 145 0.0); DIMTVP
    		 (cons 146 0.64); DIMTFAC
    		 (cons 147 Gap_From_dimension_Line_to_Text); 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 7); DIMZIN
    		 (cons 79 1); DIMAZIN
    		 (cons 170 0); DIMALT
    		 (cons 171 0); DIMALTD
    		 (cons 172 1); DIMTOFL
    		 (cons 173 1); DIMSAH
    		 (cons 174 0); DIMTIX
    		 (cons 175 0); DIMSOXD
    		 (cons 176 256); DIMCLRD
    		 (cons 177 256); DIMCLRE
    		 (cons 178 256); DIMCRRT
    		 (cons 179 0); DIMADEC
    		 ;(cons 270 4); DIMUNIT
    		 (cons 271 Decimal_Places); DIMDEC
    		 (cons 272 Tolerance_Decimal_places); DIMTDEC
    		 (cons 273 4); DIMALTU
    		 (cons 274 0); DIMALTTD
    		 (cons 275 0); DIMAUNIT
    		 (cons 276 1); DIMFRAC
    		 (cons 277 4); DIMLUNIT
    		 (cons 278 0); DIMDSEP
    		 (cons 279 Text_Movement); DIMTMOVE
    		 (cons 280 0); DIMJUST
    		 (cons 281 0); DIMSD1
    		 (cons 282 0); DIMSD2
    		 (cons 283 1); DIMTOLJ
    		 (cons 284 3); DIMTZIN
    		 (cons 285 1); DIMALTZ
    		 (cons 286 0); DIMALTTZ
    		 ;(cons 287 0); DIMFIT
    		 (cons 288 0); DIMUPT
    		 (cons 289 0); DIMATFIT
    		 (cons 340 (tblobjname "style" Text_Name)); DIMTXSTY
    		 ;(cons 341 (cdr (assoc 330 (entget (tblobjname "block" "."))))); DIMLDRBLK
    		 (cons 342 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK
    		 (cons 343 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK1
    		 (cons 344 (cdr (assoc 330 (entget(tblobjname "block" "_Oblique"))))); DIMBLK2
    		 (cons 371 -2); DIMLWD
    		 (cons 372 -2); DIMLWE
    		 ); end of list
    	       ); end of entmake
    	    ); end of setq
          
          ); end of progn
        ); end of if
      
    
    (command "-dimstyle" "_save" Dim_Name "Yes")
    ; SET DIMSTYLE CURRENT
    (command "-dimstyle" "restore" Dim_Name)
    (entmod (entget mm4_duct_dimension_code))
    ; SET TEXTSTYLE CURRENT
    (command "textstyle" Text_Name)
    
    (princ)
    ); END OF MM4-Duct_DIMSTYLE

Similar Threads

  1. Modify Ordinate Dimension Origin
    By stusic in forum AutoLISP
    Replies: 3
    Last Post: 2013-09-24, 09:46 PM
  2. Conduit modify/create
    By ldcadd127 in forum Parts Builder
    Replies: 4
    Last Post: 2009-02-13, 02:22 AM
  3. Modify Multileader Style - Help please
    By john.lincoln in forum AutoCAD General
    Replies: 4
    Last Post: 2008-12-29, 10:53 PM
  4. linear dimension style: no leader + position dimension
    By eddy.lermytte in forum Revit Architecture - General
    Replies: 3
    Last Post: 2006-02-01, 02:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •