Jump to content
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

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.

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.


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.

  • Create New...