Jump to content

Create DIMSTYLE lisp question, true-color fill color


Recommended Posts

Posted

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

Posted

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.

Posted

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

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

Posted

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.

Posted (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 by Aftertouch
Posted

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.

 

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