dxt to hpgl

J

Thread Starter

Justin

I am using Acad2000 and I need to convert a dxf file to hpgl or *.plt extension. I have set up a 7550a plotter in acad and am printing to file.
this seems to work but I get some erroneous characters at the beginning of the string and i dont get the pen up (pux,y) and pen down (pdx,y). I get pupa(x,y) and pdpa (x,y). this does not work well for my import software. It like the
pu(x,y) pd(x,y) commands. anyone have anything or maybe a different hp driver that will give me the proper output information. similar to Corel Draw file structure. It will bring a dxf file in and export as a *.plt file efficiently with carriage returns and no erroneous information. I SHOULD be able to go directly from ACAD right? I will try my ACAD V14 seat and see if it is different. Any help is good help.

Justin
 
C

Curt Wuollet

Hi Justin

cat filename1 | sed s/pupa/pu | sed s/pdpa/pd > filename2.

You can also do this in one shot with a sed script file.

Or you can use gawk.

Oh, never mind, this is that useless command line stuff.

You don't have sed or gawk.

You don't have a C compiler to write a simple filter either.

And I'll bet you don't have the source for the driver to make this trivial change.

Go to the nearest Linux box and do the above.

Regards

cww
 
K
Or install the standard perl distribution and do this on whatever platform you happen to be using. (I'm guessing that ACAD (AutoCad?) runs mainly on Windows).

Or install the free and very capable UNIX tools from Cygwin (from a google search, "unix on windows":

Cygwin
... Cygwin is a UNIX environment for Windows. It consists of two parts: A DLL (cygwin1.dll)
which acts as a UNIX emulation layer providing substantial UNIX API ...
Description: Win32 ports of the popular GNU development tools
Category: Computers > Software > Operating Systems > Unix > Win32
sources.redhat.com/cygwin/ - 13k - Cached - Similar pages

...) and do what Curt so curtly suggested doing. ;) Of course you may eventually see the advantages to not just emulating UNIX, but command line tools *are* possible on Windows.

Ken

--
Ken Irving <[email protected]>
 
C

Curt Wuollet

Hi Ken

Of course the best solution would be to have the source for your printer drivers so you could make this trivial change and get exactly what you want with no fuss and no extra steps.

And my point is that umpteen solutions to this and other very common oft recurring problems make Linux an excellent OS to use for automation. People think it's all about GUIs and ease of use. I think a more important criteria is functionality out of the box for the things that automation people do. I can post simple solutions for an awful lot of the problems I see on the list. Unfortunately, they are Linux solutions and are not a part of Windows. Some can be ported and some can be addded on, but it's clear that Linux was intended to provide those tools and Windows was not. If the vendors would port their tools, the combination would be much more powerful and functional even if the tools remained closed. And it would be very beneficial to them, especially with the upcoming license changes and drastically reduced churn, broader platform support and customization possibilities. It would be a happy WIN/WIN for everyone. The much lower costs and better stability wouldn't hurt either. One OS is aimed squarely at working with hardware, comms, text ,conversions, etc. and the other is heading the other way fast, even to the point of eliminating serial ports, ISA cards, and other things we need that aren't a part of their plan. Again, it's not religion, it's engineering. It's really clear from my perspective which would support automation better.

Regards

cww
 
Justin <[email protected]>
> > I get pupa(x,y) and pdpa (x,y). this does not work well for my
> > import software. It like the pu(x,y) pd(x,y) commands.

Curt:
> cat filename1 | sed s/pupa/pu | sed s/pdpa/pd > filename2.
...
> Oh, never mind, this is that useless command line stuff.

> You don't have sed or gawk.

Curt, that's needlessly nasty...

You can download sed for Windows - the package is called `cygwin' and contains a lot of the goodies that make the linux command line so powerful.

The Windows command line works the same way[1], and you can set it up so it happens when you double-click a file with a particular extension.


If you don't have the `cat' command, just write it like this:
sed s/pupa/pu < filename1 | sed s/pdpa/pd > filename2.

Jiri
[1] as far as the user is concerned; there's some technical disadvantages behind the scenes, but they're not important here.
--
Jiri Baum <[email protected]> http://www.csse.monash.edu.au/~jirib
MAT LinuxPLC project --- http://mat.sf.net --- Machine Automation Tools
 
C

Curt Wuollet

Thanks Jiri,

See my later post, I suggest loading the UNIX tools, but couldn't remember what they were called. The cygwin tools are one, but I was thinking of another from someone who used to do emulators. Anyway my point was not to be nasty, merely to show how Linux is better suited for the kind of stuff automation folks do. The hundreds of free utilities, the accessability of the serial ports and other things important to automation tasks, make solving problems that require time and money with MS, trivial and free with Linux. This factor is underappreciated, yet is a major part of why I couldn't get by without my trusty Linux box. We habitually, without even thinking, gawk, grep, sort and script away problems that are show stoppers with the alternatives. I thought about it a little and there are at least 7 standard gnu utilities you could use to correct this. And it is of some help to give the Linux solution. By now, almost every shop has a Linux box someplace you can use.

Regards

cww
 
A

Alex Pavloff

From: "Alex Pavloff" <[email protected]>
To: <[email protected]>
Subject: Re: SOFT: dxt to hpgl

Curt, the problem wasn't really an automation problem. It was a general purpose issue with a driver that outputted improper pen commands. Your method of solving the problem work, but I can think of a couple ways off hand to do the exact same thing under Windows. The OS isn't the issue here. Yes, believe or not, Window does in fact have text search and replacement
capabilities, and you don't have to buy Microsoft Text Search And Replacement Server Version 2.0 for $699 per client to do it with.

For those with old unsupported plotters though (and I've never found a plotter that was supported, but that's probably just my luck),
www.winline.com has a Windows printer driver that I've used before to drive old plotters. It might be worth a look.

Alex Pavloff
Software Engineer
Eason Technology
 
Please be a little more specific on where to start with this.... your information did not mean anything to me.

Where do I start??

justin
 
Please be a little more specific on where to start with this.... your information did not mean anything to me.

Where do I start??

justin
 
C
Hi Alex,

> > See my later post, I suggest loading the UNIX tools, but couldn't
> > remember what they were called. The cygwin tools are one, but I was
> > thinking of another from someone who used to do emulators. Anyway
> > my point was not to be nasty, merely to show how Linux is better
> > suited for the kind of stuff automation folks do.
>
> Curt, the problem wasn't really an automation problem.

True, but a lot of the problems automation people have aren't strictly automation problems. They are problems none the less. Problems with serial ports, problems with file conversion, it still requires a lot of glue sometimes to put things together. Linux, and UNIX in general, do a lot better job of supporting these needs out of the box. Even DOS did a better job out of the box. These things are neglected, even deprecated in the
later MS offerings and we often need them. That's my point.

It was a general
> purpose issue with a driver that outputted improper pen commands. Your
> method of solving the problem work, but I can think of a couple ways off
> hand to do the exact same thing under Windows. The OS isn't the issue here.

If you got 'em, post 'em.

Solving the problem in as little time and with as little effort as possible is the issue here. These little snags can hang you up for days. I am merely making the case for having a full toolbox. And it isn't strictly Linux, many people remember DOS fondly for the access it provided. These simple non-graphical tools are really needed for the stuff automation people do. Solving minor problems quickly and for free has alway been popular with my management. With all that's included in any Linux distro it's kinda like having Norton Utilities on steroids. A lot of the older guys will know what I mean by that. MS has taken a more and more hands off approach for years and that's not good for automation and other fields where we work closer to the hardware. I don't think we matter to them. They are even trying to get rid of serial ports because office people don't need them. And their licensing nonsense doesn't reflect our needs. I am trying to make the case that Linux better serves _our_ needs. I'm totally up front about that.

> Yes, believe or not, Window does in fact have text search and replacement
> capabilities, and you don't have to buy Microsoft Text Search And
> Replacement Server Version 2.0 for $699 per client to do it with.

Please demonstrate how to script that for the original app.
>
> For those with old unsupported plotters though (and I've never found a
> plotter that was supported, but that's probably just my luck),
> www.winline.com has a Windows printer driver that I've used before to drive
> old plotters. It might be worth a look.

And if the driver came with source, and the OS came with a compiler, that would be a 10 minute permanent fix. And it would be fixed right.
No credit card needed.

Regards

cww
 
A
> Even DOS did a better job out of
> the box. These things are neglected, even deprecated in the
> later MS offerings and we often need them. That's my point.

You're saying DOS did a better job of support the user's needs than Windows? Are you conveniently ignoring the fact that DOS providing a fraction of what Windows can do? (and yet, cost the same amount that Windows does now!)

> > It was a general purpose issue with a driver that outputted improper pen

> > commands. Your method of solving the problem work, but I can think of a

> > couple ways off hand to do the exact same thing under Windows. The OS
> > isn't the issue here.
>
> If you got 'em, post 'em.

Sure -- use the much maligned Windows Scripting Host, included with Windows since Windows 98 and available for Windows 95. You don't even need a
compiler! Just type in some JScript or VBScript to do the work. VBScript even has a built in regular expression parser. How's that for easy.

If you want to use Perl, go to "www.activestate.com":http://www.activestate.com and download the *FREE* and *OPEN SOURCE* version of Perl for Windows.

Or, as someone else suggested, go and download the all Unix tools for Windows.

> Solving the problem in as little time and with as little effort as
> possible is the issue here.

And your answer is "Use Linux, because you have a C compiler so you can fix the problem and recompile the program yourself."

> These little snags can hang you up for...

Do you know why people get irritated, Curt? Its because you take an isolated issue and use that as a starting point to go off into page-long one-paragraph rant about how Linux can solve all the problems that people have.

> Please demonstrate how to script that for the original app.

Alright, you really want it?

Dim regEx, fileobj, strFile,fso,f ' Create variables.
Set fso = CreateObject("Scripting.FileSystemObject") ' Create
filesystem object
Set regEx = New RegExp ' Create regular expression.
Set f = fso_OpenTextFile("C:\Foo.DXF", 1 )

regEx.Pattern = "pupa" ' Set pattern.
newtext = regEx.Replace(f.ReadAll, "pu") ' Make replacement
regEx.Pattern = "pdpa" ' Set pattern.
newtext = regEx.Replace(newtext , "pd") ' Make replacement

Set MyNewFile = fso.CreateTextFile("c:\output.txt", True)
MyNewFile.Write newtext
MyNewFile.Close

Put this into a file called Whatever.VBS and double click on it. It would look pretty much the same in Perl or JScript or whatever. It may not have the one line compactness of your sed/awk line, but it gets the job done, and after all, that's what's really important, isn't it? See, there's a reason that Microsoft put the scripting engine in Windows in the first place, even though its primary purpose has been to cause mayhem and destruction.

> And if the driver came with source, and the OS came with a compiler,
> that would be a 10 minute permanent fix. And it would be fixed right.
> No credit card needed.

And if every user in the world knew how to use a C compiler and hack code, that might even be a viable option.

Alex Pavloff

Software Engineer

Eason Technology
 
M

Michael Griffin

>> Even DOS did a better job out of
>> the box. These things are neglected, even deprecated in the
>> later MS offerings and we often need them. That's my point.

>You're saying DOS did a better job of support the user's needs than Windows?
>Are you conveniently ignoring the fact that DOS providing a fraction of what
>Windows can do? (and yet, cost the same amount that Windows does now!)
<clip>

I don't want to get involved in the Linux versus Windows arguement that seems to be developing, but I thought you might like to know that the relative prices you are quoting are a bit off. I looked up the price of Windows at "The Future Shop" (the biggest computer/electronic retailer in this country - "http://www.futureshop.ca":http://www.futureshop.ca ), and came up with the following numbers.

Microsoft Windows XP Professional (PC) $500
Microsoft Windows XP Home Edition $300

Either these prices are an introductory discount, or Microsoft has reduced their prices because I recall Windows NT as being a good deal more (I
suspect the former). The above prices are for normal versions in english (some of the french language packages, but not others, are priced higher for no obvious reason). Upgrade prices are a bit lower, but of course this doesn't take into account the price you already paid for the previous version of Windows.

The last price I can recall paying for DOS was about $60. You can see from the above that there is a very considerable increase from this price to that for the latest version of Windows. I don't want to judge whether Windows is a good value for the price charged, but it is certainly not cheap. This price difference should be kept in mind when comparing DOS and Windows.

By comparison, the same web site was selling Caldera Open Linux 2.4 for $9.99. I don't want to comment on the relative merits of Linux or
Windows, but I thought the contrast in prices for comparable products was interesting.
::

**********************
Michael Griffin
London, Ont. Canada
**********************
 
D

Donald Pittendrigh

Hi All

Anyone who is prepared to pay $500 for XP, please contact me.
In my country it is less than half this and I will pay the postage.

I think over here about R1500 or $150 would do it.

Bye
Donald Pittendrigh

 
I did a double take on those numbers too, those were Canadian dollars. The exchange rate is little over 1.5.

At buy.com a new XP Professional goes for $299 USD.

Jay Kirsch
 
Top