Get the coordinate of a component

duandian.rb (545 Bytes)
I want to know the endpoint coordinates of a component, but I don’t know what’s wrong with my code.In the picture, components can be generated but endpoints are not.

when I generate the entity directly in the code,the endpoint coordinates can be gived,but when I use “Components”,the code will not work.

A component doesn’t have endpoints (vertices). It has an origin point though which can be given from component.transformation.origin.

So what’s the rationale for laying out components like skelion does,such as I select a face,and how do I get the coordinates of it.Thanks for a lot!

In your code juste replace the line 11 ent.each do |entity| by inst.definition.entities.each do |entity|

I work it out!Thanks for a lot!

For the record, when using components, you have acces to the geometry through the definiton which is shared across its component instances :wink:

@skyfire Jason, please post code instead of screenshots of code.

Read …