示例#1
0
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

import time
from mousecontrol import MouseControl
from perspective import Perspective

import sys
if sys.platform == 'win32':
    import CLR
    from CLR.System.Reflection import Assembly
    Assembly.LoadFrom("WiimoteLib.dll")
    Wiimote = CLR.WiimoteLib.Wiimote
else:
    from linuxWiimoteLib import Wiimote


class Options:
    #constants
    LCLICK = 0
    RCLICK = 1
    SCROLL = 2
    TOGGLETOUCHPAD = 3
    NONE = 4
    DCLICK = 5
    MCLICK = 6
示例#2
0
import sys
path = u'K:\\ObjectARX 2013\\inc\\'
sys.path.append(path)

import clr
from CLR.System.Reflection import Assembly
Assembly.LoadFrom(path + 'AcDbMgd.dll')
Assembly.LoadFrom(path + 'AcCoreMgd.dll')
Assembly.LoadFrom(path + 'AcMgd.dll')

import Autodesk.AutoCAD.DatabaseServices as ads
import Autodesk
import Autodesk.AutoCAD.Runtime as ar
import Autodesk.AutoCAD.ApplicationServices as aas
import Autodesk.AutoCAD.DatabaseServices as ads
import Autodesk.AutoCAD.Geometry as ag
import Autodesk.AutoCAD.Internal as ai
from Autodesk.AutoCAD.Internal import Utils


def msg():

    doc = aas.Application.DocumentManager.MdiActiveDocument
    ed = doc.Editor
    ed.WriteMessage("\nOur test command works!")


cc = ai.CommandCallback(msg)
#n = "msg"
#Utils.AddCommand('pycmds', n, n, ar.CommandFlags.Modal, cc)
doc = aas.Application.DocumentManager.MdiActiveDocument