I have a couple of plates & beams that I want to make them into block individually, but then also grouping them altogether into one big block so that they can be scaled together in AutoCAD.
I could not figure out a way to do this, could somebody please help? Attached is the Grasshopper script that I used.
p/s: if possible, could you please show me how to colour each line differently as well? Currently it comes into AutoCAD as all black no matter how I try. Cheers!
SPECKLE.gh (16.2 KB)
Hi @Hung , two points:
-
in your current script, try creating an
Instance
from your first (nested) definition, and passing that instance into thegeometry
: https://latest.speckle.systems/projects/3f895e614f/models/647254f4e4@e5f1e77098
-
Coloring right now (afaik) is not supported in our legacy grasshopper connector out of the box: you can use a c# component to create a
displayStyle
object that contains the color and attach it to your definition geometry instead.
On this note, the Next-Gen Grasshopper connector (alpha) lets you assign colors easily, but currently does not have block support
We’ll be adding block support soon in our Beta release, I’ll let you know when that is ready!
Thank you Clare, it works!
Put the coloring aside, can we set the layer instead? So within a block definition, can different geometry be set onto different layer so that they will be placed onto that layer in AutoCAD?
There isn’t an easy way to set the layer in the legacy connector.
You’d have to place objects within a Collection
class programmatically, where the name of the collection corresponds to the name of the layer. For blocks this is even more complicated: you would need to include a dynamic layer
property on the geometry inside your block definition to get it on the correct layer.
You could try this with the extend speckle object
node in the legacy connector, before you pass your geometry to the block definition, and see if it works - this may get your definition objects on the right layer, but not the instances.
We currently don’t have block support in the Next-Gen alpha release of GH, but will be adding it for the beta. After beta is released, you should be able to easily add block geometry to specific layers with the Create Collection
node.
See this thread for reference on both: https://speckle.community/t/creating-collections-in-c-speckle-sharp-rhino-gh/18049/6
Hi Claire,
Not trying to jump the gun but do you know if Next-Gen Grasshopper connector has added block yet and if not is there a time estimate for it? Thank you
Blocks (including nested blocks) will be included in the beta release of Grasshopper, which will be out end of this week or beginning of next week!
That’s exciting!!!
A quick clarification: with the upcoming blocks, you can easily assign colors and materials to both objects inside the definition
and instances
. You can also easily assign top level instances
to layers.
While it is possible to assign definition objects to layers, it is not the most easy with our current implementation. Is it important for you to be able to easily assign definition objects to specific layers?
I’m not sure as I’m not a draftsmen
I think my goal is to use Grasshopper to get 2D representative of a set of 3D components as nested blocks and then assign layers appropriately before sending it to AutoCAD.
Also when it sends a block to AutoCAD and I make changes and send it again it does not seems to override the old one, is there a way around it?
You could try the Create
receive mode if you’re using the legacy AutoCAD connector, I believe the default Update
mode only updates the position of new blocks, but won’t update the definition of the block itself, if the block already exists in your document. The Create
mode will always create new blocks with new definitions, but the downside is that it wont delete the old blocks.
A more exciting update: the new Grasshopper 3.5.0 beta connector now includes blocks and nested blocks, you can install it from the app and test it out! See this post for all updates:🚀 Grasshopper Beta is Here
When receiving these blocks in our new Autocad connector, your previous layers and blocks will be deleted and replaced with the new layers and blocks.