VS:CreateRoof

From Vectorworks Developer
Jump to: navigation, search

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

Description

Function CreateRoof creates a new roof object in a VectorWorks document, returning a handle to the object. To define the roof object template, use AppendRoofEdge.
Table - Roof Miter Styles
Miter Style Constant
Vertical 1
Horizontal 2
Double 3
Square 4
FUNCTION CreateRoof(
genGableWall  :BOOLEAN;
bearingInsetDistance  :REAL;
roofThickDistance  :REAL;
miterType  :INTEGER;
vertMiterDistance  :REAL) : HANDLE;
def vs.CreateRoof(genGableWall, bearingInsetDistance, roofThickDistance, miterType, vertMiterDistance):
    return HANDLE

Parameters

genGableWall BOOLEAN Specifies gable roof generation.
bearingInsetDistance REAL Bearing inset distance of wall into roof.
roofThickDistance REAL Roof thickness.
miterType INTEGER Miter style of roof.
vertMiterDistance REAL Vertical component for double miters.

Remarks

Use AppendRoofEdge() to define the roof plan.

genGableWall: Create wall object on gable ends, otherwise no wall is created. bearingInset is where the weight of the roof rests on the wall. This is an inset from the defining edge of the roof plan. miterType: 1: vertical miter, 2: horizontal miter, 3: double miter , 4: square miter vertMiter: Specifies vertical len of double miter.

Example

VectorScript

PROCEDURE Example;
{ Create a new hatch and add it to the resource list. }
VAR
	roofHandle : HANDLE;
	gabID : INTEGER;
	batID : INTEGER;
	hID : INTEGER;
BEGIN
	roofHandle:=CreateRoof(TRUE,5 1/2",5 1/2",4,9.52627");
	AppendRoofEdge(roofHandle,-77'10",-25'3.18078",45",2'0",10'0");
	AppendRoofEdge(roofHandle,-41'2",-25'3.18078",45",2'0",10'0");
	AppendRoofEdge(roofHandle,-41'2",21'4.81922",45",2'0",10'0");
	AppendRoofEdge(roofHandle,-77'10",21'4.81922",45" ,2'0",10'0");
	gabID:=CreateGableDormer(roofHandle);
	SetGableAttributes(roofHandle,gabID,TRUE,6'0",10'0",2'0",#45,#45);
	SetDormerAttributes(roofHandle,gabID,3,18'4",TRUE,3'0",63,FALSE,
	3'0");
	SetDormerThick(roofHandle, 2",1.83333");
	
	batID := CreateBatDormer(roofHandle);
	SetBatAttributes(roofHandle,batID,TRUE,5'0",10'0",4'0",6'3",2'0",#8);
	SetDormerAttributes(roofHandle,batID,3,18'4",TRUE,3'0",63,FALSE,3'0");
	SetDormerThick(roofHandle, 2",1.83333");
	
	hID := CreateHipDormer(roofHandle);
	SetHipAttributes(roofHandle, hID,TRUE,6'0",10'0",2'0",#45,#45,#45);
	SetDormerAttributes(roofHandle,hID,3,18'4",TRUE,3'0",63,FALSE,3'0");
	SetDormerThick(roofHandle, 2",1.83333");
END;
RUN(Example);

Python

def Example():
	roofHandle = vs.CreateRoof(True,5.5,5.5,4,9.52627)
	vs.AppendRoofEdge(roofHandle,-77*12+10,-25*12+3.18078,45,2*12,10*12)
	vs.AppendRoofEdge(roofHandle,-41*12+2,-25*12+3.18078,45,2*12,10*12)
	vs.AppendRoofEdge(roofHandle,-41*12+2,21*12+4.81922,45,2*12,10*12)
	vs.AppendRoofEdge(roofHandle,-77*12+10,21*12+4.81922,45 ,2*12,10*12)
	
	gabID = vs.CreateGableDormer(roofHandle)
	vs.SetGableAttributes(roofHandle,gabID,True,6*12,10*12,2*12,45,45)
	vs.SetDormerAttributes(roofHandle,gabID,3,18*12+4,True,3*12,63,False,3*12)
	vs.SetDormerThick(roofHandle, 2,1.83333)
	
	batID = vs.CreateBatDormer(roofHandle)
	vs.SetBatAttributes(roofHandle,batID,True,5*12,10*12,4*12,6*12 + 3,2*12,8)
	vs.SetDormerAttributes(roofHandle,batID,3,18*12 + 4,True,3*12,63,False,3*12)
	vs.SetDormerThick(roofHandle, 2,1.83333)
	
	hID = vs.CreateHipDormer(roofHandle)
	vs.SetHipAttributes(roofHandle, hID,True,6*12,10*12,2*12,45,45,45)
	vs.SetDormerAttributes(roofHandle,hID,3,18*12+4,True,3*12,63,False,3*12)
	vs.SetDormerThick(roofHandle, 2,1.83333)
Example()

Version

Availability: from VectorWorks 8.0

See Also

VS Functions:

VS:AppendRoofEdge

VS Functions: [[VS:AppendRoofEdge]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox