Jump to content
Developer Wiki and Function Reference Links ×

Script for walls


Xaver77

Recommended Posts

Hello everyone, I just created a script with the multi tool where it selects the walls tool and at the same time puts the wall on the correct class and level. How can I add to the script so that I can set the right style for the Walls tool?

 

Procedure CustTool;
VAR 
Name:STRING;
Result:BOOLEAN;
BEGIN 
PushAttrs;
Result := DeleteAllComponents(nil);
Result := InsertNewComponentN(nil, 1, 15, -366, 14, 2, 2, 2);
Result := SetComponentName(nil, 1, 'Putz');
Result := SetComponentClass(nil, 1, 13);
Result := SetComponentFillColors(nil, 1, 257, 256);
Result := SetComponentPenColors(nil, 1, 257, 256, 257, 256);
Result := SetComponentUseFillClassAttr(nil, 1, FALSE);
Result := SetComponentUsePenClassAttr(nil, 1, TRUE, TRUE);
Result := InsertNewComponentN(nil, 2, 200, -130, 14, 14, 2, 2);
Result := SetComponentName(nil, 2, 'Beton');
Result := SetComponentClass(nil, 2, 213);
Result := SetComponentFillColors(nil, 2, 257, 256);
Result := SetComponentPenColors(nil, 2, 257, 256, 257, 256);
Result := SetComponentUseFillClassAttr(nil, 2, FALSE);
Result := SetComponentUsePenClassAttr(nil, 2, TRUE, TRUE);
Result := InsertNewComponentN(nil, 3, 15, -366, 14, 2, 2, 2);
Result := SetComponentName(nil, 3, 'Putz');
Result := SetComponentClass(nil, 3, 13);
Result := SetComponentFillColors(nil, 3, 257, 256);
Result := SetComponentPenColors(nil, 3, 257, 256, 257, 256);
Result := SetComponentUseFillClassAttr(nil, 3, FALSE);
Result := SetComponentUsePenClassAttr(nil, 3, TRUE, TRUE);
PenSize(14);
PenPatN(2);
SetZVals(0", 0);
NameClass(' ▲ 00 Standard - Mauerwerk');
Layer('03_Waende');

SetPref( 3, True );
SetPref( 1013, True );
SetPref( 1014, False );
SetPref( 1015, False );
SetPrefReal( 78, 1.000000 );
SetPrefReal( 79, 1.000000 );
SetPrefReal( 1019, 1000.000000 );
SetPrefReal( 1020, 1000.000000 );
SetPrefReal( 1021, 0.000000 );
SetPrefReal( 1022, 2540.000000 );
SetPrefReal( 1023, 2540.000000 );
SetPrefReal( 1024, 25400.000000 );
SetPrefReal( 1025, 25400.000000 );
SetPrefReal( 1026, 0.000000 );
SetPref( 35, False );
SetPref( 36, False );
SetPref( 1027, True );
SetPref( 1028, True );
SetPref( 1029, True );
SetPref( 1030, True );
SetPref( 1031, True );
SetPref( 1032, True );
SetPref( 1033, True );
SetPref( 1067, True );
SetPrefString( 1034, '45.000000;30.000000' );
SetPref( 1035, True );
SetPref( 1036, True );
SetPrefReal( 53, 0.000000 );
SetPref( 1037, True );
SetPref( 1038, True );
SetPref( 1039, True );
SetPrefReal( 1040, 0.100000 );
SetPref( 4, False );
SetPrefReal( 1041, 2.000000 );
SetPref( 1042, False );
SetPrefReal( 1043, 0.000000 );
SetPref( 1044, False );
SetPrefReal( 1045, 0.500000 );
SetPref( 1046, True );
SetPref( 1047, False );
SetPrefReal( 1048, 0.000000 );
SetPref( 1049, True );
SetPref( 1050, True );
SetPrefReal( 1051, 0.250000 );
SetPrefReal( 1052, 0.000000 );
SetPref( 1053, False );
SetConstrain('qswdf');
CallTool(-208);
PopAttrs;
END;
Run(CustTool);

Link to comment

I just read your script more closely.  You are manually setting all of the components of the wall. You don't need or want any of that if you are going to use styles.

 

You should be able to replace all the lines that start with Result with the single SetWallPrefStyle line.

 

You can probably get rid of almost all of the SetPref section also. Do you really need to set the snapping preferences and grid preferences as part of the tool?

 

SetSlabPreferencesStyle(Name2Index('Slab Style Name'));

SetRoofPrefStyle(Name2Index('Roof Style Name'));

 

 

Link to comment

Thanks for the help! Now the thing works. Attached are the scripts for the community

 

 

Procedure WallTool;
VAR 
Name:STRING;
Result:BOOLEAN;
BEGIN 
SetTool(-208);
Result:=SetWallPrefStyle('FR_Ziegel__200');
NameClass(' ❒ 06 Bauteile - Wände');
Layer('03_Waende');
SetPref(44,TRUE);
END;
Run(WallTool);

 

 

Procedure SlabTool;
VAR 
Name:STRING;
Result:BOOLEAN;
BEGIN 
SetTool(-248);
SetSlabPreferencesStyle(Name2Index('FR_Bodenplatte-Parkett_Ei'));
NameClass(' ❒ 06 Bauteile - Bodenplatte');
Layer('03_Bodenplatte_1');
SetPref(44,TRUE);
END;
Run(SlabTool);
 

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