Grasshopper

algorithmic modeling for Rhino

Python component to Get Used Components and Libraries - Learning

I'm posting this python component because I have a feeling it will be redundant/unnecessary in the near future due to the upcoming implementation of Yak. (which sounds awesome).
http://developer.rhino3d.com/guides/yak/what-is-yak/

This component was a good learning experience for me and I thought I would share.  Hopefully there are some bits that might help you too.

With that said it will analyze the current GH document, and perform 2 actions:

  1. It will list all the used components and write them to a text panel. The component will automatically create the text panel if it does not exist. Text is formatted as a string. Text is listed in a "mock" outline/indented format. Text is overwritten each time the component is run....take it for whatever it's worth.  NOTE:a refinement could/should include looking inside clusters, currently this does not.
  2. It will gather the list of plug-in libraries and versions, and write them to a text panel.

This type of (de)serialization of information is valuable when multiple people are working/sharing files. Perhaps a more interesting/future development would be writing the information to a database, and over time, your organization could start to see trends.

I am posting two versions of the user objects. 
1 - the procedural version, done in rhino 5. (GetComponents3.ghuser)
2 - the SDK mode version, done in rhino 6, ready to be compiled...as of the current WIP. (this will not work in rhino 5). (GetUsedComps_SDKMode)

There are too many people to thank for continually contributing to this forum, but I would be remiss if I did not specifically mention
Giulio Piacentino, Andrew Heumann, Anders Holden Deleuran, and Brian Ringley. I have learned a lot from your discussions and contributions to the forum. Thanks!

Relevant discussions:
http://www.grasshopper3d.com/forum/topics/override-disable-zui-disp...

Views: 1497

Attachments:

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service