Aftertouch Posted December 13, 2019 Posted December 13, 2019 Hello all, Got myself another tough one... i want to create dimstyles with LIPS, code below works like a charm... BUT.... I want the variable DIMTFILLCLR to be 255,255,255 to set the text fill color to a true color. But i can only set the variable to a index number. When i manualy change the color to 255,255,255 in the DIMSTYLE dialog. The variable DIMTFILLCLR returns 7. But when i check the settings, it shows the variable is actualy 255,255,255. How does this work/ how can i set the color to a true color? (defun CREATEDIMENSIONSTYLE (stylename textstyle / ) (command "-DIMSTYLE" "ANNOTATIVE" "YES" stylename "RESTORE" stylename) (setvar "DIMDLI" 5) (setvar "DIMSE1" 1) (setvar "DIMSE2" 1) (setvar "DIMBLK" "_Dot") (setvar "DIMLDRBLK" "_Dot") (setvar "DIMASZ" 0.1) (setvar "DIMCEN" 0) (setvar "DIMTXSTY" textstyle) (setvar "DIMTFILL" 2) ;; fillcolor 255,255,255 (setvar "DIMTAD" 1) (setvar "DIMTMOVE" 1) (setvar "DIMGAP" 0.7) (setvar "DIMDEC" 2) (setvar "DIMADEC" 1) (command "-DIMSTYLE" "SAVE" stylename "YES") (princ) ) Quote
dlanorh Posted December 13, 2019 Posted December 13, 2019 Unfortunately you can't do it using the dimstyle system variables. These are a throw back to a time before true colors and are the nearest index approximation to a true color. It is possible you can do this in a round about way using activex (visual lisp) by creating a temp style, inserting a dim, overriding the property then using the copyfrom method to create the new dimstyle using the inserted dim as the source. then delete the temp style. Quote
BIGAL Posted December 13, 2019 Posted December 13, 2019 Not sure if it will work but did you try 255, 256 is bylayer. Quote
Aftertouch Posted December 19, 2019 Author Posted December 19, 2019 Hello all, Sorry for my late response. Could someone help me on this one? I tried the method dlanorh suggested. But this keep returning color '7' to me, even tho i set the value to 255,255,255 Quote
dlanorh Posted December 19, 2019 Posted December 19, 2019 12 minutes ago, Aftertouch said: Hello all, Sorry for my late response. Could someone help me on this one? I tried the method dlanorh suggested. But this keep returning color '7' to me, even tho i set the value to 255,255,255 Post the code you have so far. Quote
tombu Posted December 19, 2019 Posted December 19, 2019 BIGAL's suggestion worked for me. Index color 255 is the same as True Color 255,255,255. The variable DIMTFILLCLR only accepts index colors. Quote
Aftertouch Posted December 20, 2019 Author Posted December 20, 2019 (edited) 12 hours ago, tombu said: BIGAL's suggestion worked for me. Index color 255 is the same as True Color 255,255,255. The variable DIMTFILLCLR only accepts index colors. Hi tombu, On screen it looks the same, but the CTB file then misses it up again... And i cannot change my CTB file. And yes, it does only accept index colors. but i can set the color in the DIMSTYLE manualy... and then it works. Even tho the variable then returns '7' instead of 255,255,255.... So it has to be possible somehow.. Edited December 20, 2019 by Aftertouch Quote
tombu Posted December 20, 2019 Posted December 20, 2019 The only Fill color I've ever used is Background. It plots only the Text and blanks out the area behind it. Isn't that what you want anyway? If you want it to display a white background on the screen while you're working set the Uniform background color to White in Options. 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.