CoCreate User Forum  

Go Back   CoCreate User Forum > Applications > CoCreate Drafting

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 05-29-2003, 01:19 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Thumbs up Right Click Translation to DXF, IGES, etc.

If you do a lot of translation of MI files to some other format you might want to try this out. That attached Web Archive file contains instructions on how to setup Windows so that you can right click one or more *.mi files in Explorer and translate them to any of the export formats supported by Drafting/ME10 (DXF, DWG, DWF, IGES, VRML). This is a much easier than using the user interface or batch method to translate several MI files.

If anyone can't view the attached file let me know. I can attach a PDF as well, but it is not as clear.
Attached Files
File Type: mht right_click_xlate.mht (39.9 KB, 3102 views)
__________________
John Scheffel
Reply With Quote
  #2  
Old 06-01-2004, 04:17 PM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
Just wanted to mention that I tried this on OSD12 Annotation and it works the same. Thanks for posting this. Now I just need to figure out how to get it to handle multi-sheet drawings properly (lumps them on top of each other right now). Bet there's a switch I'm missing somewhere...
Reply With Quote
  #3  
Old 06-02-2004, 10:29 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
Originally posted by May Kung
Bet there's a switch I'm missing somewhere...
Unfortunately I don't think there is a switch to make the DXF translator handle multisheet drawings correctly. If you find one let us all know.

Someone recently asked me if there was an easy way to save all the sheets in a drawing as DXF instead of doing them one at a time. I wrote a quick and dirty macro to do this from inside Drafting. It saves each sheet to a temporary MI file then translates it to DXF so that you end up with one DXF file for each sheet. I will do some cleanup on it and post it here when it's ready.

Another option would be to use the "Arrange Sheets" goodie before saving the MI file from Annotation. After translation to DXF, you will end up with all the sheets lined up in a horizontal row.

Hopefully CoCreate will provide better multiple sheet handling for both Annotation and Drafting in the future (such as plotting all the sheets in one shot, saving them to different formats, etc).
__________________
John Scheffel
Reply With Quote
  #4  
Old 06-02-2004, 12:31 PM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
Well, I have an open call with CoCreate Support to deal with saving multi-sheet drawings in one shot. If they find a switch, I will definitely post it here.

Just being able to save a multi-sheet Annotation drawing into multiple MI files (one per sheet) would be of assistance. Unfortunately, my knowledge of Drafting can probably fill a thimble.
Reply With Quote
  #5  
Old 06-07-2004, 03:42 AM
Harry Harry is offline
Registered User
 
Join Date: Jan 2004
Posts: 85
hello John,

I am sorry to say that I can not download your attachment. Can you make it pdf please? Or can you give me a tip how to download it correctly?


Best regards,

Harry
Reply With Quote
  #6  
Old 06-07-2004, 09:44 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
I can't open the file directly by left clicking the link either. I think this worked when I first posted it, but with all the anti-virus protections our company has added in the last year maybe it has been disabled.

However, I can download it. If you right click and select "Save Target As...", you should be able to save the file to your Desktop or a local folder. Double clicking the file should open it in Internet Explorer.
__________________
John Scheffel
Reply With Quote
  #7  
Old 06-08-2004, 09:03 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
Originally posted by John Scheffel
I wrote a quick and dirty macro to do this from inside Drafting. It saves each sheet to a temporary MI file then translates it to DXF so that you end up with one DXF file for each sheet. I will do some cleanup on it and post it here when it's ready.
As promized here is the macro file. Just INPUT this file. It will automatically run the Cust_save_all_sheets_dxf macro when INPUT, but you can delete that line at the end if you want to setup a button to run it.

Attachment deleted since it contained an error, see new attachment below
__________________
John Scheffel
Reply With Quote
  #8  
Old 06-08-2004, 09:43 AM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
I downloaded the macro and it got partway through before saying that "MEDIR" was not a defined macro. Am I missing something?
Reply With Quote
  #9  
Old 06-08-2004, 09:57 AM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Quote:
Originally posted by May Kung
I downloaded the macro and it got partway through before saying that "MEDIR" was not a defined macro. Am I missing something?
Oops. I thought I had removed everything that relied on our internal customizations, but I missed that one. As part of our startup we set a variable named Medir which is the install path for Drafting (such as C:\CoCreate\OSD_Drafting_12.01). The reasons are mostly historical since more recent versions of Drafting include a command MEDIR which returns this value. This was not true in older versions so we have a lot of old macros which use the variable Medir.

Try the attached file in which Medir has been replaced by MEDIR. It also contains a correction to the prompt, which said the file would be named ".mi" and should have been ".dxf".

Attachment deleted since it did not work, see new attachment below
__________________
John Scheffel
Reply With Quote
  #10  
Old 06-09-2004, 01:22 PM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
Well, I no longer get an error message, but I also do not get any DXF files. I see window open briefly, apparently the DXF converter kicking on in the background, but it blinks by so quickly I don't have the chance to see what it says.

For the heck of it, I tried running this under Annotation using:
Code:
(oli::sd-execute-annotator-command :cmd (format nil "input 'save_sheets_dxf.m'"))
I don't get an error, but it also doesn't do anything. Strange.
Reply With Quote
  #11  
Old 06-10-2004, 12:04 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
May, can you try running the following command and post the result.

DISPLAY (MEDIR)

I suspect your problem may be related to a MEDIR path containing blanks. Our internal installation process uses a path with no blanks to avoid some odd issues that may occur.

I did some playing around with the macro and figured out how to make it work with a MEDIR path containing blanks. Not as easy as I thought, since enclosing the executable path in double quotes did not work (as it does in DOS or a command window). It turned out I had to enclose the entire command string in double quotes as well. Not sure why, but it seems to work.

Try the attached file and see if it now works for you.
Attached Files
File Type: m save_sheets_dxf.m (3.4 KB, 1236 views)
__________________
John Scheffel
Reply With Quote
  #12  
Old 06-10-2004, 01:09 PM
May Kung May Kung is offline
Registered User
 
Join Date: Oct 2002
Location: San Jose, CA
Posts: 301
Hi John,

You hit the nail on the head. My path is:

C:/Program Files/CoCreate/OSD_Drafting_12.00/

The revised code works like a charm in Drafting. I'll be trying it out on a few other files of mine, but I think it should be fine. Time-permitting, I'm going to see if I can make it work from within Annotation.

Thanks again for sharing this code. It's greatly appreciated.
Reply With Quote
  #13  
Old 08-22-2006, 11:51 PM
kowts kowts is offline
Registered User
 
Join Date: Aug 2006
Posts: 1
Re: Right Click Translation to DXF, IGES, etc.

John,

Can i do the same method for right click to print to PDF or MDI file ?
What 's the command line to put ?

Sam
Reply With Quote
  #14  
Old 08-24-2006, 10:00 AM
Wolfgang's Avatar
Wolfgang Wolfgang is offline
Registered User
 
Join Date: Nov 2002
Location: ... near Sindelfingen near Stuttgart, Germany
Posts: 754
Re: Right Click Translation to DXF, IGES, etc.

DXF, IGES, DWG can be created from mi files using an external application: the translators are standalone executables.

PDF and MDI can only be created from within Drafting. So that way, with a another startup.m file given on command line level (if possible) it might be possible, too, to create a PDF via right-mouse-click. But in this case you need a license AFAIK (for a few seconds).

Wolfgang
Reply With Quote
  #15  
Old 08-24-2006, 03:00 PM
John Scheffel's Avatar
John Scheffel John Scheffel is offline
Administrator
 
Join Date: Sep 2002
Location: San Jose, CA
Posts: 1,288
Re: Right Click Translation to DXF, IGES, etc.

What is an MDI file? I have never heard of that format.

You can customize the standard right click Print to output PDF by modifying your <install-dir>\customize_p.m file. For more details see the "Plotting multiple drawings on Windows" section of the appendix.htm file under the Drafting install folder. As Wolfgang mentioned using this method might require brief access to a license.

As an example, if you add the following lines to customize_p.m before the Start_plotting_process line at the bottom then right click printing will go to a PDF file rather than your default printer.

INQ_ENV 0
PLOTTER_TYPE "PDF_GENERIC"
PLOT_FORMAT "A"
PLOT_DESTINATION ((INQ 304) + ".pdf")
WIN_PRT_MGR ORIENTATION LANDSCAPE COPIES 1 END

To define a new right click button to print to PDF would be more complicated. The right click Print of *.mi files that installs with Drafting uses a command of the form:

<install-dir>\me10.exe -pelook 0 -p "%1"

The essentially runs Drafting as a background process and automatically loads the contents of the customize_p.m file to set the print options then runs the Start_plotting_process macro. It is possible to start Drafting with with a command similar to this and have it load and run other macros and commands from other files, but that requires much more customization.
__________________
John Scheffel
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 09:09 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.