KendiKong Posted April 19, 2016 Posted April 19, 2016 (edited) I have a lisp that makes several dimensions. I need to know how I can convert some of them(not all) into decimal format with 3 decimal places with an " suffix at the end. If somebody can tell me the exact command and syntax I would use for that that would be great Oh and another thing, how would I change the dim style of some dimensions that I made in lisp? (not through AutoCAD, in LISP) Edited April 19, 2016 by KendiKong Quote
broncos15 Posted April 19, 2016 Posted April 19, 2016 I have a lisp that makes several dimensions. I need to know how I can convert some of them(not all) into decimal format with 3 decimal places with an " suffix at the end. If somebody can tell me the exact command and syntax I would use for that that would be great Oh and another thing, how would I change the dim style of some dimensions that I made in lisp? Do a vlax-dump of all the dimension information, the necessary information is all in there. I use Lee Mac's lisp routine to do dump the information http://lee-mac.com/dumpobject.html. All you will need to do is use the vla-put functions. Quote
KendiKong Posted April 19, 2016 Author Posted April 19, 2016 Not exactly what I need. Its pretty simple. I just need to the autolisp syntax for converting dimension to decimal with a suffix: " Quote
broncos15 Posted April 19, 2016 Posted April 19, 2016 Learning how to do a dump and examine the information will help you accomplish this (if you look at the dump or go the acadauto.chm file it will tell you how to accomplish it). Learning how to use the vla functions (and where the information is stored) will be immensely helpful for learning how to write LISP routines. Quote
KendiKong Posted April 19, 2016 Author Posted April 19, 2016 Well I'm still a beginner at lisp, so I'll try taking a look at this some time, but for now I would just like to know how to change a regular dimension property to decimal with this suffix: " Quote
broncos15 Posted April 19, 2016 Posted April 19, 2016 1)Use ssget to have the user select only dimensions (look at Lee's reference for the ssget function found here: http://lee-mac.com/ssget.html) 2)Make use of a repeat function where you convert the selection set to a vla-object using vlax-ename->vla-object. 3)Within the repeat function use vla-put-stylename function because I would recommend just creating another style that has the everything set that you want because this is a better CAD practice. 4)You will want to use either the vla-put-TextOverride or the vla-put-textsuffix functions to put a suffix. 5)Close the repeat function Quote
paulmcz Posted April 19, 2016 Posted April 19, 2016 Being a beginner myself, I run this code: (defun c:deci () (setvar "dimpost" "<>\"") (setvar "dimlunit" 2) (setvar "dimdec" 3) (princ) ) Then I go to Dimension menu > Update and select all the dimensions I want to change. Quote
tombu Posted April 19, 2016 Posted April 19, 2016 Why not just create that as a child Dimension style then select the Dimensions to change to that style? Quote
BIGAL Posted April 20, 2016 Posted April 20, 2016 Try this (while (setq obj (entsel)) (setvar "dimdec" 3) (command "-dimstyle" "a" obj "") ) Quote
Recommended Posts
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.