Jump to content
Sign in to follow this  
Yancka

Custom object displaying insertion Z value

Recommended Posts

1. SetFPat(TextHandle,0) will set the fill to None;

SetVectorFill is used to set hatches, gradients, and I think images also.

2. You need to find the text width (GetBBox) and calculate the leader start point. My suggestion would be to have the control point as the starting point for both the text and the leader, similar to the callout tool. If the control point is on the left side of the beam midpoint, the text would be right justified; if on the right side, then it would be left justified. Rather than creating the line and then moving it, it would better if you calculate the starting and ending points first and then draw the line.

3. Recursive plugins? Never tried it because I have not had a need for it but I guess it is possible. To insert plugins in VS you call:

FUNCTION CreateCustomObjectN(objectName:STRING;

pX,pY:REAL;

rotationAngle:REAL;

showPref:BOOLEAN) : HANDLE;

The problem would be that you cannot edit any of the parameters for the inserted plugin directly from the OIP and only the parent plugin parameters will be visible.

I would keep them separate and add another parameter that can identify it as part of a combined section.

Share this post


Link to post

a couple snippets.

Place this just after you text creation

GetBBox(lnewobj,x1,y1,x2,y2);

Moveto(x1,y1);lineto(x2,y1);lineto(x2,y2);lineto(x1,y2);lineto(x1,y1);

This will draw a tidy box around your text.

3. Yes you can insert PIO inside other PIO and adjust the parameters. If you do you are treading in unchartered territory. I started a few posts mid last year. With little response from anyone...

Since then we have been using nested PIO extensively. Objects are nested 3-4 layers deep. I have found that 3D objects perform better than 2D. Sometimes 2d lines don't generate. It can be a bit buggy, but I have found this technique very useful.

Here is the general layout of how it is set up:

VAR

ObjectName:STRING;

HObject: HANDLE;

DadVar: REAL;

MumVar:STRING

GrandMaVar:Boolean;

ObjectName:='The_PIO_You_Will_Install';

HObject:= CreateCustomObjectN(ObjectName,0,0,0,False);

SetRField(HObject,ObjectName,'VarNameOfChild1_Int',Num2Str(1,DadVar));

SetRField(HObject,ObjectName,'VarNameOfChild2_Str',MumVar));

Note use of Num2String.

All values passed to your child PIO need to be passed as Strings.

Now where you will often trip up is getting the parent and child variables mixed.

VAR

GrandMaVar: Boolean;

SetRField(HObject,ObjectName,'VarNameOfChild3_Boo',GrandMaVar));

This will not work.

VarNameOfChild3_Boo is a Boolean.

and GrandMaVar is Boolean

BUT you must always pass a STRING in.

GradMaVar which is going to be used to control the Boolean in the child needs to be a string in the Parent

GrandMaVar:=True; {Boolean}

is ver different to

GrandMaVar:='True'; {String}

Get it?.

Share this post


Link to post

Got it. And nested the same plugin into itself. Actually made it recursive. One time even made it recursive indefinitely and had to kill VW... :)

The current issue is parameter visibility. If I insert my custom plugin '3D Steel Beam' into itself with different parameter settings on OIP visible parameter set is the one for last inserted instance. Ie, if last inserted '3D Steel Beam' is I-beam then I-Beam visibility set takes precedence, nevertheless mother '3D Steel Beam' visibility set is set for Assembly (word game - I named combined beam 'Assembly' in order to memorize Assembly within this plug-in for his assistance on VS. Yet have to figure which part could be named 'Miguel' :)). If child '3D Steel Beam' insertion code is commented out the parameter visibility is OK.

Is there a workaround for this?

Or should I make another PIO which then would be mother PIO for '3D Steel Beam' PIOs?

Assembly, 3-4 layers deep nested plug-ins sound intriguing. Just curiosity - what type of objects you make in such manner and what is purpose of doing so?

The long code again, current version:

{3D Steel Beam; V1.7; written by Janis Prodnieks}
PROCEDURE SteelBeam;
VAR
BeamLength, ItemElevation, BeamHeight, BeamWidth, WebThickness, FlangeThickness, FiletRadius, FiletRadius2, BeamDiameter, TempReal, TextX, TextY :REAL;
DocumentTextStyle :INTEGER;
ExtrHnd, PluginHandle, LeftLBeam, RightLBeam, MainIBeam :HANDLE;
ItemNumber, BeamType :STRING;
{---- ---- ---- ---- ---- ---- PROFILE PROCEDURES ---- ---- ---- ---- ---- ----}
PROCEDURE IBeamProfile(h,b,s,t,R1 : REAL);
BEGIN
BeginPoly;
	AddPoint(-b/2,0);
	AddPoint(b/2,0);
	AddPoint(b/2,-t);
	AddPoint(s/2+R1,-t);
	ArcTo(s/2,-t,R1);
	AddPoint(s/2,-h+t+R1);
	ArcTo(s/2,-h+t,R1);
	AddPoint(b/2,-h+t);
	AddPoint(b/2,-h);
	AddPoint(-b/2,-h);
	AddPoint(-b/2,-h+t);
	AddPoint(-s/2-R1,-h+t);
	ArcTo(-s/2,-h+t,R1);
	AddPoint(-s/2,-t-R1);
	ArcTo(-s/2,-t,R1);
	AddPoint(-b/2,-t);
EndPoly;
END;

PROCEDURE UBeamProfile(h,b,s,t,R1,r2 : REAL);
BEGIN
BeginPoly;
	AddPoint(-b/2,0);
	AddPoint(b/2,0);
	AddPoint(b/2,-t+r2);
	ArcTo(b/2,-t,r2);
	AddPoint(-b/2+s+R1,-t);
	ArcTo(-b/2+s,-t,R1);
	AddPoint(-b/2+s,-h+t+R1);
	ArcTo(-b/2+s,-h+t,R1);
	AddPoint(b/2-r2,-h+t);
	ArcTo(b/2,-h+t,r2);
	AddPoint(b/2,-h+t-r2);
	AddPoint(b/2,-h);
	AddPoint(-b/2,-h);
EndPoly;
END;


PROCEDURE LBeamProfile(h,b,t,R1,r2 : REAL);
BEGIN
BeginPoly;
	AddPoint(-b/2,0);
	AddPoint(-b/2,-h);
	AddPoint(b/2,-h);
	AddPoint(b/2,-h+t-r2);
	ArcTo(b/2,-h+t,r2);
	AddPoint(-b/2+t+R1,-h+t);
	ArcTo(-b/2+t,-h+t,R1);
	AddPoint(-b/2+t,-r2);
	ArcTo(-b/2+t,0,r2);
EndPoly;
END;


PROCEDURE RectBeamProfile(h,b,s: REAL);
VAR
OuterPolyH, HolePolyTemplateH: HANDLE;
R1: REAL;
BEGIN
R1:=2.5*s;
IF s<6 THEN R1:=2*s;
IF s>10 THEN R1:=3*s;
BeginPoly;
	AddPoint(-b/2+R1+s,0);
	AddPoint(b/2-R1-s,0);
	ArcTo(b/2,0,R1+s);
	AddPoint(b/2,-R1-s);
	AddPoint(b/2,-h+R1+s);
	ArcTo(b/2,-h,R1+s);
	AddPoint(b/2-R1-s,-h);
	AddPoint(-b/2+R1+s,-h);
	ArcTo(-b/2,-h,R1+s);
	AddPoint(-b/2,-h+R1+s);
	AddPoint(-b/2,-R1-s);
	ArcTo(-b/2,0,R1+s);
EndPoly;
OuterPolyH:=LNewObj;
BeginPoly;
	AddPoint(-b/2+R1+s,-s);
	AddPoint(b/2-R1-s,-s);
	ArcTo(b/2-s,-s,R1);
	AddPoint(b/2-s,-R1-s);
	AddPoint(b/2-s,-h+R1+s);
	ArcTo(b/2-s,-h+s,R1);
	AddPoint(b/2-R1-s,-h+s);
	AddPoint(-b/2+R1+s,-h+s);
	ArcTo(-b/2+s,-h+s,R1);
	AddPoint(-b/2+s,-h+R1+s);
	AddPoint(-b/2+s,-R1-s);
	ArcTo(-b/2+s,-s,R1);
EndPoly;
HolePolyTemplateH:=LNewObj;
IF AddHole(OuterPolyH,HolePolyTemplateH) THEN DelObject (HolePolyTemplateH);
END;


PROCEDURE RoundBeamProfile(D,t: REAL);
VAR
OuterPolyH, HolePolyTemplateH: HANDLE;
BEGIN
Oval(-D/2,0,D/2,-D);
OuterPolyH:=LNewObj;
Oval(-D/2+t,0-t,D/2-t,-D+t);
HolePolyTemplateH:=LNewObj;
IF AddHole(OuterPolyH,HolePolyTemplateH) THEN DelObject (HolePolyTemplateH);
END;
{---- ---- ---- ---- ---- ---- PLUG-IN SPECIFIC OTHER SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE SetInitialParameterVisibility;
BEGIN
SetParameterVisibility(PluginHandle,'I Beam Size',false);
SetParameterVisibility(PluginHandle,'U Beam Size',false);
SetParameterVisibility(PluginHandle,'L Beam Size E',false);
SetParameterVisibility(PluginHandle,'L Beam Size NE',false);
SetParameterVisibility(PluginHandle,'Sq Beam Size',false);
SetParameterVisibility(PluginHandle,'Rect Beam Size',false);
SetParameterVisibility(PluginHandle,'Round Beam Size',false);
SetParameterVisibility(PluginHandle,'Height h',false);
SetParameterVisibility(PluginHandle,'Width b',false);
SetParameterVisibility(PluginHandle,'Web Thickness s',false);
SetParameterVisibility(PluginHandle,'Flange Thickness t',false);
SetParameterVisibility(PluginHandle,'Radius R',false);
SetParameterVisibility(PluginHandle,'Radius  r',false);
SetParameterVisibility(PluginHandle,'Diameter D',false);
SetParameterVisibility(PluginHandle,'Flip h and b',false);
SetParameterVisibility(PluginHandle,'Flip vertically',false);

SetParameterVisibility(PluginHandle,'L-Beam on Side',false);
SetParameterVisibility(PluginHandle,'Left LB type',false);
SetParameterVisibility(PluginHandle,'LLB Size E',false);
SetParameterVisibility(PluginHandle,'LLB Size NE',false);
SetParameterVisibility(PluginHandle,'LLB Custom Size',false);
SetParameterVisibility(PluginHandle,'LLB Height h',false);
SetParameterVisibility(PluginHandle,'LLB Width b',false);
SetParameterVisibility(PluginHandle,'LLB Flange t',false);
SetParameterVisibility(PluginHandle,'LLB Radius R',false);
SetParameterVisibility(PluginHandle,'LLB Radius  r',false);
SetParameterVisibility(PluginHandle,'LLB flip h and b',false);
SetParameterVisibility(PluginHandle,'Right LB type',false);
SetParameterVisibility(PluginHandle,'RLB Size E',false);
SetParameterVisibility(PluginHandle,'RLB Size NE',false);
SetParameterVisibility(PluginHandle,'RLB Custom Size',false);
SetParameterVisibility(PluginHandle,'RLB Height h',false);
SetParameterVisibility(PluginHandle,'RLB Width b',false);
SetParameterVisibility(PluginHandle,'RLB Flange t',false);
SetParameterVisibility(PluginHandle,'RLB Radius R',false);
SetParameterVisibility(PluginHandle,'RLB Radius  r',false);
SetParameterVisibility(PluginHandle,'RLB flip h and b',false);
END;



PROCEDURE SetInitialVariables;
BEGIN
ClosePoly;

PluginHandle:=FSactLayer;
ItemNumber:= PNumber;

BeamLength:= PLineLength;
ItemElevation:= PTop_Elevation;
BeamHeight:= PHeight_h;
BeamWidth:= PWidth_b;
WebThickness:= PWeb_Thickness_s;
FlangeThickness:= PFlange_Thickness_t;
FiletRadius:= PRadius_R;
FiletRadius2:= PRadius__r;
BeamDiameter:=PDiameter_D;
TextX:=PControlPoint01X;
TextY:=PControlPoint01Y;
END;


PROCEDURE SetStandardSizeGeneralVisibilities;
BEGIN
EnableParameter(PluginHandle,'Height h',false);
EnableParameter(PluginHandle,'Width b',false);
EnableParameter(PluginHandle,'Web Thickness s',false);
EnableParameter(PluginHandle,'Flange Thickness t',false);
EnableParameter(PluginHandle,'Radius R',false);
EnableParameter(PluginHandle,'Radius  r',false);
EnableParameter(PluginHandle,'Diameter D',false);
END;


PROCEDURE SetCustomSizeGeneralVisibilities;
BEGIN
EnableParameter(PluginHandle,'I Beam Size',false);
EnableParameter(PluginHandle,'U Beam Size',false);
EnableParameter(PluginHandle,'L Beam Size E',false);
EnableParameter(PluginHandle,'L Beam Size NE',false);
EnableParameter(PluginHandle,'Sq Beam Size',false);
EnableParameter(PluginHandle,'Rect Beam Size',false);
EnableParameter(PluginHandle,'Round Beam Size',false);
END;
{---- ---- ---- ---- ---- ---- TYPE SPECIFIC VISIBILITY SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE SetIBeamVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'I Beam Size',true);
SetParameterVisibility(PluginHandle,'Height h',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Web Thickness s',true);
SetParameterVisibility(PluginHandle,'Flange Thickness t',true);
SetParameterVisibility(PluginHandle,'Radius R',true);
EnableParameter(PluginHandle,'Profile side LEFT',false);
END;


PROCEDURE SetUBeamVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'U Beam Size',true);
SetParameterVisibility(PluginHandle,'Height h',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Web Thickness s',true);
SetParameterVisibility(PluginHandle,'Flange Thickness t',true);
SetParameterVisibility(PluginHandle,'Radius R',true);
SetParameterVisibility(PluginHandle,'Radius  r',true);
END;


PROCEDURE SetLBeamEqualVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'L Beam Size E',true);
SetParameterVisibility(PluginHandle,'Profile side LEFT',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Flange Thickness t',true);
SetParameterVisibility(PluginHandle,'Radius R',true);
SetParameterVisibility(PluginHandle,'Radius  r',true);
SetParameterVisibility(PluginHandle,'Flip vertically',true);
END;


PROCEDURE SetLBeamNonEqualVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'L Beam Size NE',true);
SetParameterVisibility(PluginHandle,'Profile side LEFT',true);
SetParameterVisibility(PluginHandle,'Height h',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Flange Thickness t',true);
SetParameterVisibility(PluginHandle,'Radius R',true);
SetParameterVisibility(PluginHandle,'Radius  r',true);
SetParameterVisibility(PluginHandle,'Flip h and b',true);
SetParameterVisibility(PluginHandle,'Flip vertically',true);

IF PFlip_h_and_b=true THEN
	BEGIN
		TempReal:=BeamHeight;
		BeamHeight:=BeamWidth;
		BeamWidth:=TempReal;
	END;
END;


PROCEDURE SetSquaredBeamVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'Sq Beam Size',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Web Thickness s',true);
EnableParameter(PluginHandle,'Profile side LEFT',false);
END;


PROCEDURE SetRectangularBeamVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'Rect Beam Size',true);
SetParameterVisibility(PluginHandle,'Height h',true);
SetParameterVisibility(PluginHandle,'Width b',true);
SetParameterVisibility(PluginHandle,'Web Thickness s',true);
EnableParameter(PluginHandle,'Profile side LEFT',false);
END;

PROCEDURE SetRoundBeamVisibilities;
BEGIN
SetParameterVisibility(PluginHandle,'Round Beam Size',true);
SetParameterVisibility(PluginHandle,'Diameter D',true);
SetParameterVisibility(PluginHandle,'Flange Thickness t',true);
EnableParameter(PluginHandle,'Profile side LEFT',false);
END;


PROCEDURE SetAssemblyVisibilities;
BEGIN

SetParameterVisibility(PluginHandle,'L-Beam on Side',true);

SetParameterVisibility(PluginHandle,'Left LB type',true);
SetParameterVisibility(PluginHandle,'LLB Size E',true);
SetParameterVisibility(PluginHandle,'LLB Size NE',true);
SetParameterVisibility(PluginHandle,'LLB Custom Size',true);
SetParameterVisibility(PluginHandle,'LLB Height h',true);
SetParameterVisibility(PluginHandle,'LLB Width b',true);
SetParameterVisibility(PluginHandle,'LLB Flange t',true);
SetParameterVisibility(PluginHandle,'LLB Radius R',true);
SetParameterVisibility(PluginHandle,'LLB Radius  r',true);
SetParameterVisibility(PluginHandle,'LLB flip h and b',true);

EnableParameter(PluginHandle,'Profile side LEFT',false);
END;
{---- ---- ---- ---- ---- ---- TEXT LOCATION AND VISIBILITY SPECIFIC SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE SetTextPositionVisibilitiesAndLocation;
BEGIN
IF PFixed_Text_Position=true THEN
	BEGIN
		TextX:=BeamLength/2;
		SetRField(PluginHandle,'3D Steel Beam','ControlPoint01X',Num2Str(0,TextX));
		EnableParameter(PluginHandle,'ControlPoint01X',false);
	END;
END;
{---- ---- ---- ---- ---- ---- TYPE SPECIFIC STANDARD SIZE SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE SetIBeamStandardSize;
BEGIN
IF PI_Beam_Size='10B1'THEN BEGIN BeamHeight:=100; BeamWidth:=55; WebThickness:=4.1; FlangeThickness:= 5.7; FiletRadius:=7; END;
IF PI_Beam_Size='16B1'THEN BEGIN BeamHeight:=157; BeamWidth:=82; WebThickness:=4; FlangeThickness:= 5.9; FiletRadius:=9; END;
END;


PROCEDURE SetUBeamStandardSize;
BEGIN
IF PU_Beam_Size='5P'THEN BEGIN BeamHeight:=50; BeamWidth:=32; WebThickness:=4.4; FlangeThickness:=7; FiletRadius:=6; FiletRadius2:=3.5; END;
IF PU_Beam_Size='12P'THEN BEGIN BeamHeight:=120; BeamWidth:=52; WebThickness:=4.8; FlangeThickness:=7.8; FiletRadius:=7.5; FiletRadius2:=4.5; END;
IF PU_Beam_Size='20P'THEN BEGIN BeamHeight:=200; BeamWidth:=76; WebThickness:=5.2; FlangeThickness:=9; FiletRadius:=9.5; FiletRadius2:=5.5; END;
END;


PROCEDURE SetLBeamEqualStandardSize;
BEGIN
SetRField(PluginHandle,'3D Steel Beam','Flip h and b','False');
IF PL_Beam_size_e='20x3'THEN BEGIN BeamWidth:=20; FlangeThickness:=3; FiletRadius:=3.5; FiletRadius2:=1.2; END;
IF PL_Beam_size_e='50x4'THEN BEGIN BeamWidth:=50; FlangeThickness:=4; FiletRadius:=5.5; FiletRadius2:=1.8; END;
IF PL_Beam_size_e='70x7'THEN BEGIN BeamWidth:=70; FlangeThickness:=7; FiletRadius:=8; FiletRadius2:=2.7; END;
END;


PROCEDURE SetLBeamNonEqualStandardSize;
BEGIN
IF PL_Beam_size_ne='40x25x3'THEN BEGIN BeamHeight:=40; BeamWidth:=25; FlangeThickness:=3; FiletRadius:=4; FiletRadius2:=1.3; END;
IF PL_Beam_size_ne='63x40x8'THEN BEGIN BeamHeight:=63; BeamWidth:=40; FlangeThickness:=8; FiletRadius:=7; FiletRadius2:=2.3; END;
END;


PROCEDURE SetSquaredBeamStandardSize;
BEGIN
IF PSq_Beam_Size='50x5'THEN BEGIN BeamWidth:=50; WebThickness:=5; FiletRadius:=2.5; END;
IF PSq_Beam_Size='80x6'THEN BEGIN BeamWidth:=80; WebThickness:=6; FiletRadius:=2.5; END;
END;


PROCEDURE SetRectangularBeamStandardSize;
BEGIN
IF PRect_Beam_Size='100x60x6'THEN BEGIN BeamHeight:=100; BeamWidth:=60; WebThickness:=6; END;
IF PRect_Beam_Size='260x140x12.5'THEN BEGIN BeamHeight:=260; BeamWidth:=140; WebThickness:=12.5; END;
END;

PROCEDURE SetRoundBeamStandardSize;
BEGIN
IF PRound_Beam_Size='76x2.5' THEN BEGIN BeamDiameter:=76; FlangeThickness:=2.5; END;
IF PRound_Beam_Size='101.6x2.5' THEN BEGIN BeamDiameter:=101.6; FlangeThickness:=2.5; END;
END;

{---- ---- ---- ---- ---- ---- 2D OBJECT SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE Create2DRectangle;
BEGIN
IF PBeam_Type='Round Beam' THEN BeamWidth:=BeamDiameter;
MoveTo(0,-BeamWidth/2);
Rect(BeamWidth,#90,BeamLength,#0);
END;

PROCEDURE CreateLBeam2D;
BEGIN
Create2DRectangle;
IF PFlip_vertically=false THEN
	BEGIN
		MoveTo(0,-BeamWidth/2+FlangeThickness);
		LineTo(BeamLength,-BeamWidth/2+FlangeThickness);
		IF PProfile_Side_LEFT=true THEN FlipVer;
	END;
END;

PROCEDURE DrawLeaderLine;
BEGIN
IF PDraw_Leader=true THEN
	BEGIN
		MoveTo(TextX, TextY);
		LineTo(BeamLength/2,0);
		SetObjArrow(lnewobj,3,0.02,0,false,true);
	END;
END;

PROCEDURE CreateTextContainingBeamInfo;
BEGIN
IF PDisplay_Item_Info=true THEN
	BEGIN
		DrawLeaderLine;
		IF PBeam_Type='Round Beam' THEN BeamHeight:=BeamDiameter;

		DocumentTextStyle:=GetPrefInt(58);
		SetPrefInt(58,0);

		TextOrigin(TextX, TextY);
		CreateText(Concat(ItemNumber,CHR(13),'L-',Num2Str(0,BeamLength),CHR(13),Num2Str(3,(ItemElevation-BeamHeight)/1000)));
		SetTextSize(lnewobj,0,Len(ItemNumber),15);
		SetTextStyle(lnewobj,0,Len(ItemNumber),3);
		SetTextSize(lnewobj,Len(ItemNumber),Len(Num2Str(0,BeamLength))+3,6);
		SetTextStyle(lnewobj,Len(ItemNumber),Len(Num2Str(0,BeamLength))+3,3);
		SetTextSize(lnewobj,Len(ItemNumber)+Len(Num2Str(0,BeamLength))+4,Len(Num2Str(3,(ItemElevation-BeamHeight)/1000)),10);
		SetTextStyle(lnewobj,Len(ItemNumber)+Len(Num2Str(0,BeamLength))+4,Len(Num2Str(3,(ItemElevation-BeamHeight)/1000)),7);
		SetTextFont(lnewobj,0,Len(ItemNumber)+Len(Num2Str(0,BeamLength))+4+Len(Num2Str(3,(ItemElevation-BeamHeight)/1000)),GetFontID('Bank Gothic'));
		SetTextLeading(lnewobj,8);
	{	SetFPat(lnewobj,0);}

		SetPrefInt(58,DocumentTextStyle);
	END;
END;
{---- ---- ---- ---- ---- ---- 3D OBJECT SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE CreateExtrudeProfile;
BEGIN
IF PBeam_Type='I-Beam' THEN IBeamProfile(BeamHeight,BeamWidth,WebThickness,FlangeThickness,FiletRadius);
IF PBeam_Type='U-Beam' THEN UBeamProfile(BeamHeight,BeamWidth,WebThickness,FlangeThickness,FiletRadius,FiletRadius2);
IF PBeam_Type='L-Beam (equal)' THEN LBeamProfile(BeamWidth,BeamWidth,FlangeThickness,FiletRadius,FiletRadius2);
IF PBeam_Type='L-Beam (non-equal)' THEN LBeamProfile(BeamHeight,BeamWidth,FlangeThickness,FiletRadius,FiletRadius2);
IF PBeam_Type='Squared Beam' THEN RectBeamProfile(BeamWidth,BeamWidth,WebThickness);
IF PBeam_Type='Rectangular Beam' THEN RectBeamProfile(BeamHeight,BeamWidth,WebThickness);
IF PBeam_Type='Round Beam' THEN RoundBeamProfile(BeamDiameter,FlangeThickness);
END;
{---- ---- ---- ---- ---- ---- ASSEMBLY SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE CreateBeamAssembley;
BEGIN

LeftLBeam:=CreateCustomObjectN('3D Steel Beam',0,-10,0, false);
SetRField(LeftLBeam,'3D Steel Beam','Display Item Info','false');
SetRField(LeftLBeam,'3D Steel Beam','Beam Type','L-Beam (equal)');
SetRField(LeftLBeam,'3D Steel Beam','LineLength',Num2Str(0,BeamLength));
SetRField(LeftLBeam,'3D Steel Beam','Flip vertically','true');
SetRField(LeftLBeam,'3D Steel Beam','Profile side LEFT','true');
Move3DObj(LeftLBeam,0,0, -100);

MainIBeam:=CreateCustomObjectN('3D Steel Beam',0,0, 0, false);
SetRField(MainIBeam,'3D Steel Beam','Display Item Info','false');
SetRField(MainIBeam,'3D Steel Beam','Beam Type','I-Beam');
SetRField(MainIBeam,'3D Steel Beam','LineLength',Num2Str(0,BeamLength));

END;
{---- ---- ---- ---- ---- ---- PLUG-IN SPECIFIC GENERAL SUBS ---- ---- ---- ---- ---- ----}
PROCEDURE SetInitialInfo;
BEGIN
SetInitialVariables;
SetInitialParameterVisibility;
END;

PROCEDURE SetCustomOrStandardSizeGeneralSettings;
BEGIN
IF PCustom_Beam=false THEN SetStandardSizeGeneralVisibilities ELSE SetCustomSizeGeneralVisibilities;
IF PCustom_Beam=false THEN
BEGIN
	IF PBeam_Type='I-Beam' THEN SetIBeamStandardSize;
	IF PBeam_Type='U-Beam' THEN SetUBeamStandardSize;
	IF PBeam_Type='L-Beam (equal)' THEN SetLBeamEqualStandardSize;
	IF PBeam_Type='L-Beam (non-equal)' THEN SetLBeamNonEqualStandardSize;
	IF PBeam_Type='Squared Beam' THEN SetSquaredBeamStandardSize;
	IF PBeam_Type='Rectangular Beam' THEN SetRectangularBeamStandardSize;
	IF PBeam_Type='Round Beam' THEN SetRoundBeamStandardSize;

	SetRField(PluginHandle,'3D Steel Beam','Height h',Num2Str(0,BeamHeight));
	SetRField(PluginHandle,'3D Steel Beam','Width b',Num2Str(0,BeamWidth));
	SetRField(PluginHandle,'3D Steel Beam','Web Thickness s',Num2Str(1,WebThickness));
	SetRField(PluginHandle,'3D Steel Beam','Flange Thickness t',Num2Str(1,FlangeThickness));
	SetRField(PluginHandle,'3D Steel Beam','Radius R',Num2Str(1,FiletRadius));
	SetRField(PluginHandle,'3D Steel Beam','Radius  r',Num2Str(1,FiletRadius2));
	SetRField(PluginHandle,'3D Steel Beam','Diameter D',Num2Str(1,BeamDiameter));
END;
END;

PROCEDURE SetTypeSpecificVisibilities;
BEGIN
IF PBeam_Type='I-Beam' THEN SetIBeamVisibilities;
IF PBeam_Type='U-Beam' THEN SetUBeamVisibilities;
IF PBeam_Type='L-Beam (equal)' THEN SetLBeamEqualVisibilities;
IF PBeam_Type='L-Beam (non-equal)' THEN SetLBeamNonEqualVisibilities;
IF PBeam_Type='Squared Beam' THEN SetSquaredBeamVisibilities;
IF PBeam_Type='Rectangular Beam' THEN SetRectangularBeamVisibilities;
IF PBeam_Type='Round Beam' THEN SetRoundBeamVisibilities;
IF PBeam_Type='Assembly' THEN SetAssemblyVisibilities;
END;


PROCEDURE Create2DObjects;
BEGIN
IF PBeam_Type='I-Beam' THEN Create2DRectangle;
IF PBeam_Type='U-Beam' THEN Create2DRectangle;
IF PBeam_Type='L-Beam (equal)' THEN CreateLBeam2D;
IF PBeam_Type='L-Beam (non-equal)' THEN CreateLBeam2D;
IF PBeam_Type='Squared Beam' THEN Create2DRectangle;
IF PBeam_Type='Rectangular Beam' THEN Create2DRectangle;
IF PBeam_Type='Round Beam' THEN Create2DRectangle;
CreateTextContainingBeamInfo;
END;

PROCEDURE CreateExtrude;
BEGIN
BeginXtrd(0,BeamLength);
	CreateExtrudeProfile;
	IF PProfile_Side_LEFT=true THEN FlipHor;
	IF PFlip_vertically=true THEN FlipVer;
EndXtrd;
ExtrHnd:=LNewObj;
SET3DRot(ExtrHnd, 90, 0, 90, 0, 0, 0);
Move3DObj(ExtrHnd,0,0, ItemElevation);
END;
{---- ---- ---- ---- ---- ---- ---- ---- ---- ---- MAIN CODE ---- ---- ---- ---- ---- ---- ---- ---- ---- ----}
BEGIN
SetInitialInfo;
SetCustomOrStandardSizeGeneralSettings;
SetTypeSpecificVisibilities;
SetTextPositionVisibilitiesAndLocation;
Create2DObjects;
IF PBeam_Type='Assembly' THEN CreateBeamAssembley ELSE CreateExtrude;
END;
Run(SteelBeam);

Share this post


Link to post

The object is a 3D wall detail tool.

Essentially it draws a timber framed wall with all its parts.

Draws Timber Floor Framing

Draws Timber Flooring

Draws Timber Wall framing

Draws Building Wrap

Draws Cavity batten

Draws Cladding

(we can add most cladding types in about 5mins);

Draws Window

Draws Flashing Tape

Draws Sill & Head Flashings

Draws Claddings

Draws Timber Rafters

Draws Roof Underlay

Draws Roofing

Draws Gutter Flashing

Draws Gutter Profile

It is completely parameteric allowing for any roof pitch, height, frame size, window size.

Nesting.

Level 1

Single pane of glass.

Double glazing spacer

Level 2

Double Glazing Unit.

Uses above to make a DG unit.

Level 3

DG goes into a Window Object.

With

Aluminum Window Profile Extrusion

Level 4 Window Component Object ready for wall.

Adds Head Flashing

Window liners

Sill heights.

Allows for adjustment of object to fit in the depth of the wall.

Level 5

The Wall object itself

This has over 100 parameters

Next Step is to create a 6th level object that simplifies the parameter interface to reduce the number of settings

Share this post


Link to post

Here're 2 pieces of steel beam plugins - single beam (child) and assembly beam (parent). Take it as is (no cool icons). If you happen to notice any errors there, don't hesitate to post it here. Also if you make some useful additions & modifications. The biggest deal is with standard sizes.... errrrr. Into these PIOs there are only couple standard sizes.

Assembly, sounds like a good stuff. Me wonders whether you are messing up with Standard & Custom sizes in your multilevel PIOs and if you do, how are you dealing with size settings.

Share this post


Link to post

The BASE Level object always uses a Number as the Variable.

IE

Width:=pWidth;

Depth:=pDepth.

The SECOND Level object uses a pop up selector and creates the logic of how to size the BASE object.

ie

IF pPopUp='200x50' Then

Begin;

SetRfild(pioName,PIOHandle, 'Width', 50);

SetRfild(pioName,PIOHandle, 'Depth', 200);

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.

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.

Sign in to follow this  

 

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