Grasshopper

algorithmic modeling for Rhino

Hi Guys,

Is it possible to use the py32win Python for Windows Extensions in Rhino Python?

How do I go about installing/calling them?

Cheers

DK

Views: 708

Replies to This Discussion

I'm wanting to use win32print but currently get this error message:

Message: No module named win32print

I have installed the py32win extensions on my machine.

Cheers

DK 

You will probably need to provide more information about your case (an example file/code, how did you install py32win, which versions of the library/Rhino/Grasshopper/.NET all help to debug). Right off the bat though:

1) It looks like a 32bit library, which may be incompatible with Rhino 64bit.

2) Do you really need this, since we're running IronPython in Rhino, I'd imagine that the functionality you're looking for would be in .NET (import System) already.

Hope that helps a bit..

Edit: Some general posts (1, 2) on installing Python modules in GHPython that might help.

Hi Anders,

Thanks for that - what I'm trying to do is take a formated text string and send it directly to a printer port in RAW format. It appears I can do that with .NET API but where would I find examples of that in RhinoPython?

Cheers

DK

You probably can't. That said, if you can find an IronPython example, you should be able to implement that directly (you might need to add a reference to the specific .dll that is being used, as not all .NET namespaces are referenced by default). If that is also not possible, try to find some C# or VB code, it's usually fairly straightforward to port that to IronPython (usually, sometimes it can get quite involved and require some digging, or Giulio ;)

So after a bit more digging I've found an option that works for me:

import os
os.system('copy /b c:\spool\spool.plt LPT1')

I save my HPGL format to the folder and then the above sends it to the printer port.

Printer is actually on a USB port but all I needed to do was share the printer on the network and use this command line:

C:\spool>net use lpt1: \\DECAY\DGIP /persistent:yes

To make it use LPT1 port.

Very happy to have it working - I now have Rhino running my HPGL printer directly.

Cheers

DK

Excellent, glad you found a solution :)

Very happy to have it working - I now have Rhino running my HPGL printer directly.

Hardcore!

Not so hardcore Tom - but thanks!

I was an electronics hardware/embedded systems guy in a past life - code for me was mainly 80C51 microcontroller based stuff in assembly:

SPEED1_PUSHED:
                          MOV STATUS_FLAGS, #001H ;SET STATUS TO SPEED 1
                          SETB MOTOR_RELAY1           ;BOTH MOTOR RELAYS ON
                          SETB MOTOR_RELAY2           ;
                          CLR GRN_LED                      ;GREEN LED ONLY ON

Controlling hardware directly makes WAY more sense to me than moving data around in arrays or even OOP concepts.

Truth be told I just didn't want to HAVE to buy some 3rd party sign/vinyl cutting software to run an old vinyl cutter I've been given and using Rhino/Grasshopper/Python to run it at least seemed possible when I started looking at it a week ago.

Cheers

DK

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service