File tree 2 files changed +19
-9
lines changed
2 files changed +19
-9
lines changed Original file line number Diff line number Diff line change 1
1
#coding=utf-8
2
+
2
3
import clr
3
- import sys
4
- RhinoSystem = "C:\\ Program Files\\ Rhino 6\\ System\\ "
5
- RhinoPlugin = "C:\\ Program Files\\ Rhino 6\\ Plug-ins\\ "
6
- clr .AddReferenceToFileAndPath (RhinoSystem + "RhinoCommon.dll" )
4
+ clr .AddReference ("RhinoCommon" )
7
5
clr .AddReference ("Eto" )
8
6
clr .AddReference ("Eto.Wpf" )
9
7
clr .AddReference ("System.Windows.Forms" )
10
8
clr .AddReference ("System.Drawing" )
11
- sys .path .append ("C:\\ Program Files\\ Rhino 6\\ Plug-ins\\ IronPython\\ Lib\\ " )
12
- sys .path .append ("C:\\ Users\\ mahai\\ AppData\\ Roaming\\ McNeel\\ Rhinoceros\\ 6.0\\ Plug-ins\\ IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\\ settings\\ lib\\ " )
13
9
10
+ # init sys.path
14
11
import Rhino
15
- import scriptcontext
16
- scriptcontext .doc = Rhino .RhinoDoc .ActiveDoc
12
+ import sys
13
+ sys .path .append (Rhino .ApplicationSettings .FileSettings .InstallFolder .FullName + "Plug-ins\\ IronPython\\ Lib\\ " )
14
+ sys .path .append (Rhino .ApplicationSettings .FileSettings .GetDataFolder (True ) +
15
+ "Plug-ins\\ IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\\ settings\\ lib\\ " )
17
16
18
- # todo 这部分为了与官方的RhinoPython.Host兼容
17
+ ### init scriptcontext
18
+ # the offical Rhino.Python.Host module can not working in this environment.
19
+ # reimplement Rhino.Python.Host.Coerce3dPointFromEnumerables function.
19
20
import RhinoPython .Host
20
21
22
+ # the offical scriptcontext.doc can not working in this environment.
23
+ # assignment Rhino.RhinoDoc.ActiveDoc to scriptcontext.doc
24
+ import scriptcontext
25
+ scriptcontext .doc = Rhino .RhinoDoc .ActiveDoc
21
26
Original file line number Diff line number Diff line change 1
1
import Rhino
2
+
3
+ ### init scriptcontext
4
+ # the offical Rhino.Python.Host module can not working in this environment.
5
+ # reimplement Rhino.Python.Host.Coerce3dPointFromEnumerables function.
6
+ import RhinoPython .Host
2
7
def Coerce3dPointFromEnumerables (point ):
3
8
return Rhino .Geometry .Point3d (point [0 ],point [1 ],point [2 ])
You can’t perform that action at this time.
0 commit comments