VS:BeginXtrd: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
No edit summary
 
Line 8: Line 8:


You should call EndXtrd after the object creation procedures to complete the definition and generate the extrude object in the document.
You should call EndXtrd after the object creation procedures to complete the definition and generate the extrude object in the document.





Latest revision as of 13:19, 19 March 2019

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

Description

Procedure BeginXtrd creates a 3D extrude object in a VectorWorks document. BeginXtrd uses 2D object creation procedure calls to define the "template" for the object.

You should call EndXtrd after the object creation procedures to complete the definition and generate the extrude object in the document.

PROCEDURE BeginXtrd(
startDistance :REAL;
endDistance :REAL);
def vs.BeginXtrd(startDistance, endDistance):
    return None

Parameters

startDistance REAL Start distance from document ground plane.
endDistance REAL End distance from document ground plane.

Example

VectorScript

PROCEDURE Example;
VAR
h1, h2, h3 :HANDLE;
int :INTEGER;
BEGIN
DSelectAll; BeginXtrd(0, 1); CallTool(-203); h1 := FSActLayer; EndXtrd;
DSelectAll; BeginXtrd(0, 1); CallTool(-203); h2 := FSActLayer; EndXtrd;
int := AddSolid(h1, h2, h3);
END;
RUN(Example);

Python


Another example which will be handy for creating hybrid objects from within plug-ins:


{ ***************************************** }
{ Orso.B.Schmid, creates an extrude from a HANDLE h,
  preserving the original h. Returns a handle to the extrude }
FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE;
BEGIN
  IF h <> NIL THEN BEGIN
    BeginXtrd(z, dZ);
      LineTo(1, 1); { just draw something for creating an extrude container }
    EndXtrd;

    DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj))));
    { places a copy of h in the extrude and deletes the line }

    Create3Dobj := LNewObj;
  END;
END;

Python


Version

Availability: from All Versions

See Also

VS:EndXtrd

[[VS:EndXtrd]]