Intersect_with group with model
-
Hi All,
I would like to use the intersect_with function to intersect a group of entities with the entire model. Basically similar to the option you get from the context menu when you select a face or group and choose "intersect with->entire model".
However, I can't seem to figure out what arguments use for the intersect_function
Can you guys maybe help me out? -
Read the API guidance very carefully.
https://developers.google.com/sketchup/docs/ourdoc/entities#intersect_with
It's one of the most complicated methods, with six arguments, passed in a not-obvious order.
You'll need to make transformation[s] - even if 'empty' - to use twice.
You also need references to the 'entities' contexts for what intersects and where the resultant geometry is put... For example when you intersect a group with the model.entities do you want the intersection lines in the model.entities, the group.entities [needs to apply the group.transformation [.inverse?]] or inside a newly made group in the model OR group.entities, so they are separate from rest...
Note that the final argument must be either one 'entity' or an 'array of entities', not an entities-object. -
Thanks TIG! The problem was indeed the last argument, I put an entities object in there. working with an array instead did the job
Advertisement