Jump to content
Developer Wiki and Function Reference Links ×

Set class fill type und pen type


ane

Recommended Posts

Hi all,

I see that there are some functions to specify the pen and fill styles of a class, but none to actually set them active, for example, I can set the foreground Color used for solid fills, but how can I actually set the class to "solid fill"?

I see there is no direct function for this. I can read a classes fill style by using

vs.GetObjectVariableInt(hdl, 696)

and I found a documentation of the integer values used for the different styles (None, solid, pattern, hatch,...) on Vectorlab.info (is it possible this info is missing in the online Vectorscript Appendix?)

But somehow I can't do the same thing with vs.SetObjectVariableInt. It throws an error message

"SetObjectVariable failed with constant 696. This is typically due to the operation being not supported for the passed object handle"

So it seems that property can be read but it is write protected?

It seems to me, setting the fill style of a class is one of the most basic things to do and should be relatively easy to accomplish? What am I doing wrong here?

By the way: I'm using python, but a Pascal example would do as well.

Thanks for your help,

Andi

Link to comment

I see that there are some functions to specify the pen and fill styles of a class, but none to actually set them active, for example, I can set the foreground Color used for solid fills, but how can I actually set the class to "solid fill"?

Use PROCEDURE SetClFPat(className:STRING; fillpattern:LONGINT);

basic fillpattern codes:

0 = No fill

1 = foreground color

2 = background color

normally, you would set an object fill to the background color.

Link to comment
  • 3 weeks later...

Thanks for your input Miguel, that did the trick.

It's kind of tricky, that the first three "Raster Fill Patterns" are actually solid fills and unfortunately the fill pattern table in the online documentation Appendix is a "file not found"-Image...

Just for any future reference: According to my tests, foreground and background seem to be the other way round:

0 = no fill

1 = solid background color

2 = solid foreground Color

3 and onwards: lots of raster fill patterns following

Link to comment

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