Community
InfraWorks Forum
Welcome to Autodesk’s InfraWorks Forums. Share your knowledge, ask questions, and explore popular InfraWorks topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Randomization of trees

18 REPLIES 18
SOLVED
Reply
Message 1 of 19
ThomasBHansen__
3153 Views, 18 Replies

Randomization of trees

Hello!

 

I am wondering if there is a way to randomize the trees with the "Create trees [forest]" function.

 

I am aware that i can import trees as an entity and then use a java script to randomize them, but i would really like to randomize forests as well.

 

 

/Thomas 

 

 

Landscape Architect & technical expert
18 REPLIES 18
Message 2 of 19

Yes.  Create a Style Rule.



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 3 of 19

Thanks for the quick reply!

 

I have created a style rule, but seem to have problems applying the Rule style to my forest.

 

I used the stylized model panel and created a rule with 3 trees and saved it as "random_trees".  In the Forest properties I cannot find the rule I`ve created in the "Rule Style" box. Am I going about it the wrong way?

Landscape Architect & technical expert
Message 4 of 19

Did you click the Commit button at the bottom of the style rule?



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 5 of 19

I have tried to commit, and refresh, but with no further luck.

 

Here is a short video of what I have so far.

 

https://chronicle.autodesk.com/Main/Details/48876c57-e05e-4ba1-a5ea-44e02e55fb95

Landscape Architect & technical expert
Message 6 of 19

Hang tight.  I will create a video for you.



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 7 of 19

Interesting.  I just tried it myself and it's not working.  I use this on building all the time and it works fine.  Looks like you will need a script for this.



Todd Rogers
BIM Manager
Blog | Twitter | LinkedIn

Message 8 of 19

Thanks for trying. I will look more into this later.

Landscape Architect & technical expert
Message 9 of 19

my problem also got solved because of this issue
Message 10 of 19

How did you solve it? I still havent managed to randomize the trees.

Landscape Architect & technical expert
Message 11 of 19
s.gerber
in reply to: ThomasBHansen__

Hi Thomas, you have to select all the trees and clear the Manual Style property. The Manual Style is the one used while drawing the forest and will always overrule the Rule Style. That's why you don't see the desired effect, even if the Rule Style is correctly applied by running your rule.


Sebastian Gerber
Software Architect
Message 12 of 19

Thanks!

 

That solved my problem, but i still dont quite understand why I can`t find the name of the spesific rulestyle when going into the properties palette and browsing rule styles.

 

Should`nt I be able to find my style "3_trees_style" by browsing the properties palette? And If I have several tree styles, how does the program know which of the rules to use when i cannot define or locate the Rule Style by name in the propertis palette?

infraworks_random_trees.jpg

Landscape Architect & technical expert
Message 13 of 19
s.gerber
in reply to: ThomasBHansen__

Hi Thomas, it works a little bit different. What you see in the properties is the "Rule Style", not the "Style Rule". I.e. it is just the style that was assigned to the feature by running the rule. The feature itself doesn't know anything about which rule it has its style from.


Sebastian Gerber
Software Architect
Message 14 of 19

Hello,

 

With expression manager you can do more dynamic styling solutions. So here is another possible solution:

 

random trees

 

Good luck.

Message 15 of 19
mkt
Enthusiast
in reply to: ThomasBHansen__

Unfortunately this was not the solution for me. As far as I can se, I have the same issue as Thomas, but when I clear the manual style in properties, nothing happens. I commit and refresh my style rule again and manual style is applied again. 

 

Has anyone got some pointers?

 

At rimvydas.sabonis: What does it say in your expression?

Message 16 of 19
s.gerber
in reply to: mkt

When you cleared the manual style in the properties, did you make your changes persistend by pressing the 'Update' button at the top?


Sebastian Gerber
Software Architect
Message 17 of 19
mkt
Enthusiast
in reply to: s.gerber

Did not see that one there - Thank you!

 

BUT - it doesn't seem to work when the forest area is defined from a shp file?

Message 18 of 19
kgrover
in reply to: mkt

I am having issues with a style rule for trees as well. I have a shp file of multiple polygon areas for forested areas, and I want randomize type, size and spacing of trees in each individual polygon. 

 

I have a style rule created with several different tree types, but it is only picking one of the tree types per polygon, instead of randomizing many types in a single polygon. 

 

I have played with the expressions of the Style rule, and nothing seems to get applied to the properties of the polygon. 

 

Any help would be appreciated. 


Kevin

Message 19 of 19
s.gerber
in reply to: kgrover

Hi, the important thing to know here is, that style rules are working on a collection of features and assign exactly one style to each of the features. When drawing a forest with the draw tool, there are single point features created for each of the trees, while you have just a number of polygons when importing a shp file containing forest areas. I.e. you get only one style assigned to each of the polygons.

 

I'd propose to import the same shp file multiple times, once for each tree type, and to define different values for 'Object Spacing' and 'Object Spacing Variance' in the 'Table' tab of the 'Data Source Configuration' Dialog. This way you are also able to mimic the weight value of a style rule, i.e. a lower object scpacing value results in higher occurrence of a type of trees.

 

Hope this helps.



Sebastian Gerber
Software Architect

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report