AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Random block insertion into defined area

2 REPLIES 2
Reply
Message 1 of 3
kivist
695 Views, 2 Replies

Random block insertion into defined area

Hi!

 

Is there a command or lisp to randomly insert certain blocks (eg. trees) into polyline defined area ? So I select some area defined with polyline and then I want to insert into that area randomly lots of tree blocks (or whatever blocks).

 

Tried to google but didn't find anything useful.

 

Any ideas ? Smiley Happy

 

M.

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: kivist

Hi,

 

I did something like that with the following principle steps:

  • get bounding box of the polygon
  • for x = boundingbox.min.x to boundingbox.max.x by your x-stepsize
  •    for y = boundingbox.min.y to boundingbox.max.y by your y-stepsize
  •        here is a new xy-coordinate (like that of an array command)
  •        xnew = x + random value (within a tolerance to the left/right, positive or negative)
  •        ynew = y + random value (within a tolerance to the left/right, positive or negative)
  •        that coordinate xnew/ynew is now more randomized, depending on a higher or lower tolerance value it look more like an array or more randomized
  •        check if that new coordinate is inside the polygon
  •        if yes ==> that's a new point
  •    next y
  • next x

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3

 

1. Insert one block

2. Use array to multiply the entire area

Capture.PNG

 

3. Use MAPCLEAN.Select objects / Duplicates / Desired minimum distance

Capture.PNG

4. Use MAPTRIM. Select Boundary/Select Objects/Trim Outside Boundary

Capture.PNG

 

 

 

 

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

Post to forums  

Autodesk Design & Make Report

”Boost