The Global ARCHICAD Community

Stay informed. Get help. Share your knowledge.

Topics related to the Grasshopper-ARCHICAD Connection and the various tasks that can be achieved with it.

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy

I'm looking for a way to activate/simulate the "Set one 2D curve in ARCHICAD" through Python or C#.
Anyone familiar with the Grasshopper.Kernel SDK ... 94df75.htm and know how to prompt this command?

1. User clicks the toogle button and send a "True" boolean to Python/C# script
2. Python/C# component triggers the "Set one 2D curve in ARCHICAD" for selected component
3. User is directed to ARCHICAD to select one curve (same as happens when you right click on component and selects "Set one 2D curve in ARCHICAD"

I've been reding about controlling grasshopper components through code here: ... component/ ... omponents/

Anyone who can help me out with this?

Here's the python code:
Code: Select all
#Import libraries
import Grasshopper
import System

#Declare variables for Component Name & Menu Event
compName = "2DC"
menuEvent = "Set one 2D curve in ARCHICAD"

#Loop over objects in active document
for obj in Grasshopper.Instances.ActiveCanvas.Document.Objects:
    if obj.NickName == compName:
        menu = System.Windows.Forms.ToolStripDropDown()

        for item in menu.Items:
            if item.Text == menuEvent:
This is exactly what I'm looking for. I'm trying to set up a Human Interface for a GH-Archihcad connection script. And I need a *Set Curve in Archicad * button. (Also a set multiple windows button) Thing is I'm no good with Python. Any chance you could share your script?