News:

Please note new Forum URL: forum.designcad.com

Main Menu

DxfOut parameters

Started by beacon14, April 17, 2007, 07:40:16 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

beacon14

Hi.  I'm a longtime user (17.2) just starting to experiment with macros and I've found a hole in the documentation.  I used the Macro Record command to save a series of keystrokes including an Export Dxf command.  I am trying to save the currently selected entities but the resultant .dxf files have no data.  The saved macro file includes the following parameters with the DxfOut command:

  <Type 5, 0
  <GridType 0
  <HatchType 0
  <2PointLine 0

There is no information about parameters under the DxfOut command in the DesignCad 13 Macro Reference.  Any help would be appreciated.

Thanks,
david B

Wahoo!


beacon14

Thanks for that.  Now I know what the parameters mean.  Unfortunately it still doesn't explain why my selected vectors don't end up in the .dxf output file.

beacon14

OK, here is a more specific question.  When exporting a .dxf file, there is a check box for "save selected entities only".  Once you check this box, it remembers for the next time.  In fact, if you happen to have the icon for Export DXF in one of your toolboxes and click on it you do not get the "save selected entities only" box but it still remembers the setting from the last time the command was entered through the menu.

So I am trying to make a macro that will select certain entities and then export only the saved entities.  I was kind of hoping that if I used the command manually, checking the box, before running the macro it might work, but no joy.  I'm not getting any data in the exported files.

There is no parameter under DxfOut that corresponds to "save selected entities only".  Anybody know anything about this?  Thanks again for any help.

prl

The parameter you are looking for doesn't exist.  You could do something like this:
.
.
.

f$ = "c:\tempdfile.dcd"

>savecopy
  {
  <SelectOnly 1
  <FileName [f$]
  }

  >open
   {
   <FileName [f$]
   }

  >dxfout
  {
  <Type 5
  <GridType 0
  <HatchType 0
  <2PointLine 0
  }

  >close
  {
  <SaveChanges 0
  <Filename [f$]
  }

.
.
.

beacon14

Thank you PRL that is just the type of helpful information I was hoping for.  Someday I hope to be embarassed for asking such a rudimentary question.  For now I'm just grateful.

beacon14

Well I did it.  It took all afternoon but I was able to write my macro which takes a drawing of any number of 4x8 sheets of parts (for cutting sheet goods out on a CNC router) and exports a separate .dxf file for each layer's entities on each sheet.  20 sheets = 80 files, one macro.  Probably too specialized to be useful for most folks and I'm sure it could be made better but if anyone wants to see it I'd be happy to share.

Thanks again for helping me put on my training wheels.  Now. what else can I automate?  Hmmm...

beacon14

OK now I'm puzzled.  The macro which had been working fine now only works on one of my three computers.  The other two seem to have some sort of hang-up with opening and closing files.  I don't think it has anything to do with the Windoze version as it works on one XP computer but not on a laptop with XP nor on another desktop with Win2000.

Can anyone give me some clues as to what to look for?  Thanks again in advance.

DrollTroll

#8
Have you tried running Export DXF manually on all three computers, and compared checkbox settings and versions?


What about file paths? Are your macros saving to existing paths on all three boxes?

I'll see about adding support for SelectOnly to the dxfout and dwgout commands.
25 years with DesignCAD

beacon14

OK, I managed to get the macro to work - not sure what the problem was but it was not a function of whether the dxf out command had previously been used with "selected entities only" checked (on two of machines, once it worked, if I had previously checked "selected entities only" the resulting dxf files had no data.  I haven't tried the laptop since I don't use it much for this application and once I got it to work I stopped troubleshooting)

But now there is another problem.  The macro works fine on 17.2 but when I try it with version 18 I get the dreaded "Dcad18.exe has generated errors and will be closed by Windows.  You will need to restart the program.  An error log is being created."  Then DesignCad closes.

I wish I could say this is the only frustrating thing that has happened to me today.  Fortunately it still works properly in 17.2 so I'll have to stick with that version for now.

DrollTroll

Mind emailing me your sample drawing? I'd like to try and take a look.
25 years with DesignCAD