VS:Flip3DObj

From Vectorworks Developer
Revision as of 05:10, 21 January 2021 by CBM-c- (talk | contribs) (wikify)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

This function will flip a 3D object either horizontally or vertically. Its main use is for withing plugin objects when building their geometry and there is a need to mirror a piece.


The supported types are: Extrude, Sweep, MultiExtrude, Symbol, Mesh and CSGNode.

PROCEDURE Flip3DObj(
h :HANDLE;
horiz :BOOLEAN);
def vs.Flip3DObj(h, horiz):
    return None

Parameters

h HANDLE The handle of the 3D object to flip.
horiz BOOLEAN TRUE for a horizonal flip, FALSE for a vertical flip.

Example

PROCEDURE FlipTest;
{This script will create an extrude, dupicate it and then flip it horizontally}
VAR h1, h2 : HANDLE;

BEGIN

ClosePoly;

BeginXtrd(0', 4');
    BeginPoly;
	AddPoint( -5', 3' );
	AddPoint( 0, 3' );
	AddPoint( 0, 6' );
	AddPoint( 5', 0 );
	AddPoint( 0, -6');
	AddPoint( 0', -3');
	AddPoint(-5', -3');
    EndPoly;
EndXtrd;

h1 := LNewObj;


Move3DObj( h1, 5', 0 , 0 );
h2 := CreateDuplicateObject( h1, NIL );

Flip3DObj( h2 , TRUE );
Move3DObj( h2, -5', 0, 0 );

END;

Run(FlipTest);

Version

Availability: from Vectorworks 2010