I’m working on an architectural project and i’m using the same SketchUp model for the wiring. I know some people advise against this but the pain of updating two models seems worse than the problems of doing it all in SketchUp. Anyway, it all seems fine but I’m trying to automate some task with Rubi Api to do things like name my components. That all works great. But I would also like to determine which components a cable (always drawn as an ArcCurve) is connecting. This way I can make the Ids given to the components be reflected in the names given to the cables. So radiator TRV cable “R-A1-7” (Radiator, Block A, floor 1, Id=7) will be given the name “TC-A1-7”. So the 7 matches.
My code finds the cables and the components but I’m struggling to find the end points of the ArcCurve in the global coordinate system as well as the centre of the bounding box of the components.
What I want is a function that given an ArcCurve, or a Group with a single ArcCurve in it will answer the end points positions in the world. Also the same for a ComponentInstance, but answering its bounds.centre, also in the world coordinate system.
current I check every componentInstance (that’s been identified as a relevant component) like this:
passing in location from each end of my curve
but the points are all over the place.
Is there an existing example project that does something vaguely similar someone could point me towards?