Itoo Software Forum

RailClone => RailClone Pro (*) => Topic started by: Grey_Rift on October 15, 2019, 01:42:11 PM

Title: How to place objects based on the size of closed Spline
Post by: Grey_Rift on October 15, 2019, 01:42:11 PM
Hey Guys,

I want to create a railclone that places different buildings depending on the size of the spline. 
Using the Conditional operator didn't seem to do anything.
I believe this is because the conditional only read open splines ( I could be wrong about this).

I've added the graph with the conditional statement as an attachment.

After this didn't work I tried to write my own macro that would compare the surface of the spline and if the Spline had a bigger surface than the input number it would put the other building. But this didn't work either. An image has been attached to post aswell with the formula that I used.

Can anyone help me achieve my goal?
Title: Re: How to place objects based on the size of closed Spline
Post by: Rokas on October 17, 2019, 09:32:57 AM
Hi

I have constructed a simple scene where segment is chosen depending on area size:
(https://i.imgur.com/jYndeW0.gif)

Hope this helps
Title: Re: How to place objects based on the size of closed Spline
Post by: Michal Karmazín on October 17, 2019, 09:46:43 AM
Hi,

it would be „safer“ to check both lengths instead of the area - for example by the following expression, where exported X Size & Y Size attributes of the Segment are being used to evaluates if it fits or not:

return if(XSplineLength>Input1 && YSplineLength>Input2,2,1);

Best regards,