algorithmic modeling for Rhino
Protected Overrides Sub RegisterInputParams(pManager As Grasshopper.Kernel.GH_Component.GH_InputParamManager)
pManager.AddTextParameter("Folder", "D", "Folder", GH_ParamAccess.item, Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) & "\SquidOutput")
pManager.AddTextParameter("Filename", "F", "Filename", GH_ParamAccess.item, "SquidPrint")
pManager.AddBooleanParameter("Tiff", "T", "Save as CMYK Tiff file." & vbCrLf & "Creates additional Alpha channel file.", GH_ParamAccess.item, False)
End Sub
When I compile this component, it seems that the
"Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) & "\SquidOutput""
gets hardcoded to
"C:\Users\Mateusz\Desktop\SquidOutput"
Why does SpecialFolder function don't change the directory on someone else's computer ? I can't really find any clue about that anywhere.
Tags:
Same for me. When I invoke a new Save component, the folder is correct, but in your example file has your folder.
I think it's internalised string in the Folder Directory input of your example file, sorry ~
when I used a new Save component, the correct path was found, excuse me for the false alarm
Ah, thanks guys :D
Didn't think about that, yet I've had similar problems already.
The thing is that once you place component on the canvas, .gh file stores information about its parameters. Even if you recompile the .gha, the parameters (inputs and outputs) in this one particular .gh file persist. This is probably some anti-crash mechanism. The only solution for that is to place a new component on the canvas... it seems like only then Grasshopper calls the RegisterInputParams (which explains now that Register means register in the .gh file).
RegisterInputParams is always called, however parameter names, nicknames, descriptions and persistent data is always loaded from existing gh files. So changes made to a parameter name will not be visible when opening old files.
It's not an anti-crash thing, it's mostly that I thought it conceivable that this data could be set by a user, and thus shouldn't be wiped during a save/open cycle.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by