Jump to content

Recommended Posts

Posted

Hi all!

 

I would need a small help.

Im trying to create a dimensionstyle, with entmake. This one:

 

(entmake (list (cons 0 "DIMSTYLE") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbDimStyleTableRecord") (cons 2 "500_autodim") (cons 70 0) (cons 3 "") (cons 40 1.0) (cons 41 1.0)(cons 42 0.65) (cons 44 0.2) (cons 45 0.0) (cons 46 0.0) (cons 140 1.5) (cons 144 1.0) (cons 145 0.8) (cons 73 0) (cons 74 0) (cons 77 0) (cons 172 1) (cons 173 0) (cons 270 2) (cons 271 1) (cons 275 0) (cons 279 0)(cons 280 0)(cons 287 3)(cons 289 3)(cons 340 (tblobjname "style" "ISO")) (cons 342 (cdr (assoc 330 (entget (tblobjname "block" "_Oblique")))))(cons 371 -1)(cons 372 -1) )))

 

This would create a dimstyle with oblique styled heads at the top. The code above works only, if there is already a dimstyle with oblique arrowheads in the drawing so basically when "_oblique" block is already in the symbol table. Otherwise its giving me a lentitype error for the code 342. 

After the creation (without the 342 code) of it, the program let me change manually the dimstyle in the menu without any problem. I dont understand this :( How can I create a dimstyle with oblique head in an empty drawing? Where is this "_oblique" block stored?

 

Thanks in advance if anyone can help me.

Posted

The quick and easy use a dwt that has the "oblique" in it. Or make a dwg with 1 dim all set up and Steal it from the other dwg. Hint Lee-mac steal.

  • Like 1
Posted (edited)

Example macro using Lee Mac's Steal from Drawing to import both all "Multileader Styles" and "Dimension Styles" from your default QNEW template drawing.

^C^C^P(or C:Steal (load "StealV1-8.lsp"))(Steal (strcat (vl-filename-directory (getenv "QnewTemplate")) (chr 92) "AutoCAD Template" (chr 92) "Templates.dwt")'(("Multileader Styles"("*"))("Dimension Styles"("*")))) .regen

To import specific Styles instead of "All" replace "*" with style names separated with commas like "style1,style2,style3".

 

If like me you use this often enough to load in your acaddoc.lsp file the 

(or C:Steal (load "StealV1-8.lsp"))

would not be needed. 

Edited by tombu
Error in macro, fixed and tested version now shown.

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