Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5875

Python Hatch pattern on multiple objects

$
0
0

Hi! I’m very new to python and running into a probably simple error if anyone could help. I’m trying to make a script to duplicate a hatch and assign layers and a new hatch pattern for the duplicate. I’ve got the below worked out and it works great for a single hatch (ie I only hatch one square) For some reason if I hatch multiple objects the last command rs.hatchpattern does not work, everything else functions but the hatchpattern does not seem to run on multiple inputs.

Thanks! I’m probably missing something simple…

import rhinoscriptsyntax as rs
rs.Command("_hatch")
hatches = rs.LastCreatedObjects()
if hatches:
rs.ObjectLayer(hatches, “NC_DRAFTING::HATCH::Hatch”)
rs.CopyObject(hatches)
poche = rs.LastCreatedObjects()
rs.ObjectLayer(hatches, “NC_DRAFTING::HATCH::Poche-Light”)
rs.HatchPattern(poche, “Solid”)

this is the error I get:

Message: Parameter must be a Guid or string representing a Guid

Traceback:
line 890, in coerceguid, “C:\Users\Nick_Work\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 1062, in coercerhinoobject, “C:\Users\Nick_Work\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\utility.py”
line 237, in HatchPattern, “C:\Users\Nick_Work\AppData\Roaming\McNeel\Rhinoceros\7.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript\hatch.py”
line 12, in , “C:\Users\Nick_Work\AppData\Local\Temp\TempScript.py”

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5875

Trending Articles