Jump to content

Fill Styles in Viewports


twk

Recommended Posts

Trying to figure out how to interpret values derived from this function:

fill_style = vs.GetVPClOvrdFillStyle(viewport_handle, class_name)

 

Description says it returns the fill style of that class that has been overridden in the viewport.

 

However whenever I set the class override to a Hatch, it returns a negative index value. Changing the hatch, returns a different negative index value; Tried using the Index2Name function to try and retrieve the hatch name being applied, but it returns nothing. Does anyone know how to convert these return values to the name of the hatch.

 

By the way, from my testings return values are:

1 = Solid Fill

0 = No Fill

3 = Pattern

 

 

Cheers,

Tui

Link to comment

Nope,

When a class override is set to use a pattern, it returns 3.

 

fill_style = vs.GetVPClOvrdFillStyle(vp.viewport_handle,class_name)

However, it was returning negative index values for either a Hatch/Tile/Image/Gradient, using vs.Index2Name(-fill_style), returned the name of the resource, then using vs.GetTypeN(vs.GetObject(vs.GetName))), returned the type of resource. whew, what a mission.. but it works,

 

Thanks for the input Josh.

 

-- CORRECTION

0 - None

1 - Solid (Back)

2 - Solid (Fore)

3 and above - Indexes of the Patterns

 

anything below 0 (negatives) use vs.Index2Name with negative mod applied.

 

cheers,

Tui

 

 

Edited by twk
correction
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...