Jump to content
Developer Wiki and Function Reference Links Read more... ×
Julian Carr

Applying a Tile Resource to a Polygon

Recommended Posts

Thanks Orso. Next question.


How to get the tile fill name of a wall component. If I use GetComponentFill() then index2name() on the returned fill, it doesn't work.



Share this post

Link to post

Julian, it is indeed so tricky.

You must first check for the by class of the fill type. Otherwise GetComponentFill will return the fill type of the component, "below" the by class.

Edit: here the test file:

wall comp fill style test.vwx.zip







    sty : HANDLE;
    i, numComponents : INTEGER;
    resIndx : LONGINT;
    useClassFillStyleForFill : BOOLEAN;
    className : STRING;
    FUNCTION ResolveFillIndex(indx : LONGINT): STRING;
            CASE indx OF
            0 : ResolveFillIndex := 'none';
            1 : ResolveFillIndex := 'solid';
                ResolveFillIndex := Index2Name(-indx);
    sty := GetObject('sty');
    { a wall style named 'sty' with some components }
    { some have a fill by class, some don't }
    IF GetNumberOfComponents(sty, numComponents) THEN
        FOR i:=1 TO numComponents DO BEGIN
            useClassFillStyleForFill := FALSE; { init }
            { check if it's by class }
            IF GetCompUseClassFill(sty, i, useClassFillStyleForFill) THEN
                IF useClassFillStyleForFill THEN 
                    IF GetComponentClass(sty, i, resIndx) THEN BEGIN
                        className := Index2Name(resIndx);
                            'Component ', i, chr(13),
                            'Has fill by class. Class name: ', chr(13),
                            className, chr(13),
                            'Fill: ', ResolveFillIndex(GetClFPat(className))
                        { the underlying fill, without the by class }
                        IF GetComponentFill(sty, i, resIndx) THEN
                                'Component ', i, chr(13),
                                'UNDERLYING Fill, if it wasn''t by class: ', chr(13),
            IF (useClassFillStyleForFill = FALSE) & GetComponentFill(sty, i, resIndx) THEN
                        'Component ', i, chr(13),
                        'Fill indx not by class: ', chr(13),
                    { index 1: solid fill }
                    { index negative: vectorial fill: hatch, tile, img, gradient }




Edited by orso b. schmid
Img too large

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.