Jump to content
Developer Wiki and Function Reference Links ×

3D hole component for Point Object script


Recommended Posts

I have created a point object ot create Pre-Engineered Metal Builidng trim for Doors and windows. I would like to have it also create a 3D hole object.  Does anyone know how to do this?

 

PROCEDURE PEMBOpeningTrimPointObject;

CONST
	SourceSub = ''; {Sub path}
	ResType = 94; {Class Def}
	folderIndex = -8; {Standards}

VAR
unitmultiplier,JambComp:REAL;
H2,H3,H4: Handle;
Result:BOOLEAN;
ResourceName:STRING;
currentunits,ListId,NumItems:LONGINT;
CNo:INTEGER;

PROCEDURE ImportClass;
		BEGIN
		ListId:= BuildResourceList(ResType,folderIndex,SourceSub,NumItems);
		WHILE NumItems <> 0 
			DO BEGIN
			ResourceName:=GetNameFromResourceList(ListId,NumItems);
			IF (ResourceName = PClass1)
				THEN BEGIN
				H4 := GetResourceFromList(listID, NumItems);
				if (H4 = NIL) then
					H4 := ImportResourceToCurrentFile(listID, NumItems);
				END;
			NumItems := NumItems-1;
			END;
		END;

BEGIN 
	unitmultiplier := 1	;
	currentunits := GetPrefInt(170); {assign the current document units interger to currentunits varaiable}
	if currentunits = 1 THEN
		unitmultiplier := 25.4;
	if currentunits = 2 THEN
		unitmultiplier := 25.4;
	if currentunits = 3 THEN
		unitmultiplier := 304.8;
	if currentunits = 4 THEN
		unitmultiplier := 914.4;
	if currentunits = 5 THEN
		unitmultiplier := 1609000;
	if currentunits = 7 THEN
		unitmultiplier := 1;
	if currentunits = 8 THEN
		unitmultiplier := 10;
	if currentunits = 9 THEN
		unitmultiplier := 1000;
	if currentunits = 10 THEN
		unitmultiplier := 1000000;

	BeginGroupN(H2);

	{Import Classes if they don't exist}
		CNo:=ClassNum;
		NameClass(PClass1);
		IF CNo < ClassNum THEN
			BEGIN
				DelClass(PClass1);
				ImportClass;
			END;

	if PCreateSill = TRUE THEN JambComp := 0 ELSE JambComp := PDoorJambThickness; {Compensate for door jamb thickness}

	{Create the Trim}
		BeginXtrd(0,PTrimDepth);
		RectangleN(POpeningWidth/2+PTrimWidth+JambComp,PHeadHeight-.01+JambComp,0,90,PTrimWidth+.01,POpeningWidth+PTrimWidth*2+JambComp*2);
		RectangleN(POpeningWidth/2+PTrimWidth-.01+JambComp,PHeadHeight-POpeningHeight,0,90,POpeningHeight+JambComp,PTrimWidth+.01);
		RectangleN(-POpeningWidth/2-PTrimWidth+.01-JambComp,PHeadHeight-POpeningHeight,0,90,POpeningHeight+JambComp,-PTrimWidth-.01);
		if PCreateSill = TRUE THEN 	RectangleN(POpeningWidth/2+PTrimWidth,PHeadHeight-POpeningHeight-PTrimWidth+.01,0,90,PTrimWidth+.01,POpeningWidth+PTrimWidth*2);
		SetClass(LNewObj,PClass1);
		SetFPatByClass(LNewObj);
		SetLWByClass(LNewObj);
		SetTextStyleByClass(LNewObj);
		EndXtrd;
		SetClass(LNewObj,PClass1);
		SetFPatByClass(LNewObj);
		SetLWByClass(LNewObj);
		SetTextStyleByClass(LNewObj);
		
	EndGroup;
	Rotate3D(90,0,0);
	
	{Move object so it insets into wall}
		Move3DObj(H2,0,.01,0);
		Locus(0,0);	

END;

RUN(PEMBOpeningTrimPointObject);

 

Link to comment

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.

Guest
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.

×
×
  • Create New...