Jump to content
Developer Wiki and Function Reference Links ×

Randomize tile layout


Recommended Posts

Hello, 

 

I have hardscape area and want to randomly stagger the tiles (3-5 tile width but same height) along the hardscape. While working with Marionette and going through the library I cam across "Tiles by Computer Works" but that particular wrapper is still repeating an existing layout of the tiles. Is there any script or marionette link I could use to randomize the tiles? Attaching the snapshot to show a small patch with 4 tile sizes but I need this to come in random so that the joint between the tiles are not repeated. We have been doing this manually or using the Tiles by Computer works but it has been rejected by the main designer due to repetition of joints.

 

TIA

 

image.thumb.png.7d20c3e5236878d8298736ed6aee0a69.png

Link to comment

The .vso attachment is a plug-in tool. You can install it in your workspace and it runs like any other tool.  It lets you draw an area and it fills in with random rectangular tiles using the settings in the OIP for tile size and grout size. When you change the size of the area it just updates.

 

In the image you can see the handles showing the adjustable size of the area to be filled and the settings in the OIP.

 

My thinking was one could use it to get a pattern you liked then convert it to a group and trim away to make if fit the hardscape area.

 

I'm sure there is a cooler way.  Maybe draw the exact polygon, but then how do you set the angle of the tiles?  This is just a quick test to see if I could generate random tile layouts using 2 to 5 tile widths.  I like to do things like this on flights instead of actual work and I had a 2 hour flight yesterday.  That's enough time to test this idea, but not enough to make a hardscape path that turns corners 🙂 

 

To install the .vso:

 

Vectorworks > Preferences > User Folders tab > Reveal in Finder

 

This will open up your user folder in the finder.  Look for the plug-in folder.  Put the .vso file in the plug-ins folder.

 

Restart Vectorworks.

 

Tools > Workspaces > Workspaces…

 

You will see a list of all the workspaces you have.  One will be hightlighted and have a checkmark.  Duplicate that one.  Put the checkmark next to the new duplicate.  Edit the duplicate.

 

Give the workspace a meaningful name. I like to use the basic workspace it's based on followed by the date.  So it might be Architect 24 1 2 or Landmark 24 5 6.  

 

Click on the Tools Tab.

 

On the left side will be all the tools you could be using and many that you are using.  On the right are tool palettes.  You will see Basic and Tool Sets.  Open up Tool Sets and you will see Dims/Notes and Building Shell and Site Planning, etc.  Those correspond to the tool sets you are used to seeing in the tool palette.

 

On the left column look for a folder called MK Commands.  In there you will find Random Tiles.  Drag Random Tile to be inside of one of your tool palettes on the right side.

 

Be careful that you don't set it as a "Sub Tool". If the new tool is offset to the right in the list drag it up or down and move a little left so it lines up with all the other tools.

 

Click OK Now Random Tiles will be a tool in whatever tool set you picked.

 

Click on the tool and draw a rectangle.  The first time it runs it will put up a dialog to confirm default settings.  Ignore that.  Now you have a rectangle with random tiles.  Play around with the settings until you get something useful.

 

Post back if you have any problems installing the .vso or using the tool 🙂 

  • Like 1
Link to comment
20 hours ago, michaelk said:

The .vso attachment is a plug-in tool. You can install it in your workspace and it runs like any other tool.  It lets you draw an area and it fills in with random rectangular tiles using the settings in the OIP for tile size and grout size. When you change the size of the area it just updates.

 

In the image you can see the handles showing the adjustable size of the area to be filled and the settings in the OIP.

 

My thinking was one could use it to get a pattern you liked then convert it to a group and trim away to make if fit the hardscape area.

 

I'm sure there is a cooler way.  Maybe draw the exact polygon, but then how do you set the angle of the tiles?  This is just a quick test to see if I could generate random tile layouts using 2 to 5 tile widths.  I like to do things like this on flights instead of actual work and I had a 2 hour flight yesterday.  That's enough time to test this idea, but not enough to make a hardscape path that turns corners 🙂 

 

To install the .vso:

 

Vectorworks > Preferences > User Folders tab > Reveal in Finder

 

This will open up your user folder in the finder.  Look for the plug-in folder.  Put the .vso file in the plug-ins folder.

 

Restart Vectorworks.

 

Tools > Workspaces > Workspaces…

 

You will see a list of all the workspaces you have.  One will be hightlighted and have a checkmark.  Duplicate that one.  Put the checkmark next to the new duplicate.  Edit the duplicate.

 

Give the workspace a meaningful name. I like to use the basic workspace it's based on followed by the date.  So it might be Architect 24 1 2 or Landmark 24 5 6.  

 

Click on the Tools Tab.

 

On the left side will be all the tools you could be using and many that you are using.  On the right are tool palettes.  You will see Basic and Tool Sets.  Open up Tool Sets and you will see Dims/Notes and Building Shell and Site Planning, etc.  Those correspond to the tool sets you are used to seeing in the tool palette.

 

On the left column look for a folder called MK Commands.  In there you will find Random Tiles.  Drag Random Tile to be inside of one of your tool palettes on the right side.

 

Be careful that you don't set it as a "Sub Tool". If the new tool is offset to the right in the list drag it up or down and move a little left so it lines up with all the other tools.

 

Click OK Now Random Tiles will be a tool in whatever tool set you picked.

 

Click on the tool and draw a rectangle.  The first time it runs it will put up a dialog to confirm default settings.  Ignore that.  Now you have a rectangle with random tiles.  Play around with the settings until you get something useful.

 

Post back if you have any problems installing the .vso or using the tool 🙂 

@michaelk You are a genius. Thank you very much. This worked perfectly for me. The only issue I am facing is when there are bends along the path. I did try dividing the curves to smaller portion but the bricks don't stitch(excuse my laser scan-point cloud language) right. Do you think I can edit this .vso or if you could help me with that? My other option is to do manual work along the curves. What do you suggest? 

 

 

image.thumb.png.0bb7f720fda37c1d513c47ce6d900a38.png

Link to comment
2 hours ago, SthavyaK said:

The only issue I am facing is when there are bends along the path. I did try dividing the curves to smaller portion but the bricks don't stitch(excuse my laser scan-point cloud language) right. Do you think I can edit this .vso or if you could help me with that? My other option is to do manual work along the curves. What do you suggest? 

 

 

 

Yeah, I was afraid of that :-).  This plug-in is set up as a rectangular object.  It could be set up as a path object, but the vector math gets much more complicated. And at every radius some tiles have to be drawn as non rectangles.

 

But I think it can be done.  I don't have time to do it at the moment.  (And I have a bunch of plug-ins I'm making for my own work that are almost done and need some attention)

 

I'll post the code here if you want to play around with it.

 

Procedure RandomBricks;
{Badly Scripted by Michael Klaers.}
{April, 2024  Seattle WA}



VAR	
	objHd,recHd,wallHd														
	: HANDLE;
	
	tempH1, tempH2
	: HANDLE;

	boolResult, resultStatus
	: BOOLEAN;

	RowCounter
	: INTEGER;

	RandRectWidth, DrawHereX, DrawHereY, RowOffset
	: REAL;

	objName, RecName, FieldName, testClass,
	RadioButtonResult		
	: STRING;

{****************************** Pick A Brick Width *************}
PROCEDURE PickABrick;
VAR 
	BrickNum,RandoI  : INTEGER;
	RandoR : REAL;
	
BEGIN 
	BrickNum := TRUNC(Str2Num(pNumBrickSizes));
	RandoR := Random;
	RandoI := TRUNC(RandoR*BrickNum)+1;



	CASE RandoI OF 
		1 : RandRectWidth := pBrickWidth1;
		2 : RandRectWidth := pBrickWidth2;
		3 : RandRectWidth := pBrickWidth3;
		4 : RandRectWidth := pBrickWidth4;
		5 : RandRectWidth := pBrickWidth5;
	END; {CASE}						
END;	


{****************************** Set an X Offset *******************}
PROCEDURE OffsetX;
BEGIN
	PickABrick;
	RowOffset := RandRectWidth/2;
END;




{****************************** Draw A Brick *******************}
PROCEDURE DrawABrick;
	
BEGIN 
	
	RectangleN( DrawHereX,DrawHereY-pBoxWidth/2,
				1,0,
				RandRectWidth,pBrickHeight);
				
	DrawHereX := DrawHereX + (pGroutwidth * 2) + RandRectWidth;	
	
END;	



											{***** MAIN *****}
											{***** MAIN *****}
											{***** MAIN *****}
											
BEGIN   

	resultStatus := GetCustomObjectInfo(objName,objHd,recHd,wallHd);
	SetObjectVariableBoolean(objHd, 800, TRUE);  			{Makes text formattable}
	
	IF pUpdate THEN SetRField(objhd,GetName(recHd),'Update','FALSE');
	
	OffsetX;
	
	RowCounter := 0;
	DrawHereX := pGroutwidth - RandRectWidth;
	DrawHereY := pGroutwidth;
				
	RectangleN(
		0,(0-(pBoxWidth/2)),
		1,0,
		pLineLength,pBoxWidth);}

	WHILE DrawHereY <= pBoxWidth DO 
		BEGIN 
			While DrawHereX - RandRectWidth <= pLineLength DO
				BEGIN 
					PickABrick;
					DrawABrick;
				END; {X Loop}
			RowCounter := RowCounter + 1;
			DrawHereY := DrawHereY + pBrickHeight + pGroutwidth;
			OffsetX;	
			DrawHereX := pGroutwidth - RandRectWidth;
		END; {Y Loop}

END;

RUN(RandomBricks);

 

  • Like 1
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...