LetsConstructIT / Grasshopper-TeklaDrawingLink

Grasshopper components for interacting with Tekla drawing area
MIT License
54 stars 6 forks source link

SelectedDrawingsOnList Component #14

Closed Adam-Bednarek closed 1 week ago

Adam-Bednarek commented 8 months ago

I've created a script that creates dimensions for a simple single-part drawing, but one that Tekla itself cannot handle properly. When I use "Active drawing" component as a component that indicates which drawing is to be edited, everything works as intended. However, due to the fact that I've got hundreds of drawings to edit, I've tried using "Selected Drawings on List" component to speed things up. It does create some dimensions to correct points, however their location is all over the place. The location of dimension line is define relative to the part - for example: horizontal dimension is located at an extreme y coordinate of a part + some fixed value (let's say 200). As far as dimensions create, the script gives an error on the output - dimension line component - "Object reference not set to an instance of an object", while not printing any error "in the middle". If it's helpful for you to have a .gh file, hit me up and I'll share it.

olszewski-grzegorz commented 8 months ago

Hi! Thanks for creating this issue. This is related to the same as Issue 8.

You want to manipulate multiple drawings at once. Quite a typical need, but it is hard to achieve due to the directed acyclic graph nature of the Grasshopper combined with the single-active-drawing policy in Tekla Open API. Grasshopper is calculating nodes one by one. It does it for all of the inputs, so insertion of the drawing lines would be performed in multiple drawings at once. This is against the Tekla way of working with drawings, where every drawing is treated like a separate database.

This is a recurring problem, quite irritating for me as a software developer, where the loop concept is the standard one. In the GH world, you could try to use Anemone . Or wait ~3 months until I will release third version of Drawing Link with the main goal set to resolve looping over multiple drawings. Stay tuned!

Adam-Bednarek commented 8 months ago

Thanks for the answer, that's a great news! I'll keep my fingers crossed so you manage to sort out this issue. You're doing a great job, I appreciate your efforts!

olszewski-grzegorz commented 4 months ago

Hi @Adam-Bednarek, a little late but you can try Drawing Link's foreach loop implementation based on the script: samples/Samples.gh

More details can be found in issue: https://github.com/LetsConstructIT/Grasshopper-TeklaDrawingLink/issues/37#issuecomment-2132225036