10-12-2012 03:06 PM - edited 10-12-2012 03:35 PM
This specific invoke node I am having trouble with is the first one in my code: IEModelView Control, OpenDoc method.
For my application I need to print certain drawings (programmatically) from a shared drive. Most of these drawings are .DWG or .pdf. However, there are some drawings in the .SLDDRW format. I downloaded the free eDrawings 2012 from Solidworks in order to achieve this, but I've been running into problems with the OpenDoc method.
When LabVIEW gets to the invoke node, it "hangs," - it doesn't execute further and the VI cannot be stopped (I usually have to force-quit it with Ctrl-Alt-Del). In my code I have 30 s time delays (probably not necessary, was just making sure that eDrawings had time to finish the command) and "<Insert Your Printer Here>" as the printer name - obviously replace with your own printer's name - not that it matters because the execution does not reach that far in the code.
I'm going to post this question on the Solidworks website too (I'll post a link as a reply to this thread) incase it is more of a eDrawings debugging thing than a LabVIEW debugging thing.
The API for this method is here:
I'm running LabVIEW 2010 and eDrawings 2012 on Windows XP.
Thank you for your help!
James
These forums have been a huge help before for me - hopefully the same happens even though my question hasn't been answered before.
Solved! Go to Solution.
10-12-2012 03:30 PM
10-15-2012 11:01 AM
Hello JamesEdward,
Have you registered the ActiveX object with windows?
http://digital.ni.com/public.nsf/allkb/4F811A9B23F1D46E862566F700615B7A
Are you getting a specific error code or is it just hanging?
Thanks,
Joel C
National Instruments
10-15-2012 02:21 PM
I assumed that if I could see the ActiveX controls in the LabVIEW ActiveX browser they were registered.
But I tried:
"C:\Program Files\Common Files\eDrawings2012\EModelView.dll" /RegServer
and
"C:\Program Files\Common Files\eDrawings2012\EModelView.dll" /UnRegServer
neither worked, I got a an "Open With..." prompt. Is there a way to format these Run... commands such that it doesn't think I'm trying to open the file?
I downloaded the zip file on the help page you linked. I used that to Unregister "EModelView.dll"
I know this worked because going back into my LabVIEW program, I could not find the ActiveX controls that I was using before.
I then used that same program to register "EModelView.dll", and when I reopened, I could access those controls agian.
Except that running my LabVIEW program resulted in the same problem: Execution reaches the first Invoke node (OpenDoc) and then nothing happens.
I get no specific error code, LabVIEW just hangs.
Thank you for your help thus far! Is there any more information you need?
One Idea: I have spaces in my filepath (Documents and Settings). Would that cause an issue as the String input to the FileName argument? I convert a path control to string using the "Path to String" funtcion.
James
10-15-2012 04:24 PM
Ok - It seems to be working now- two fixes:
1) I was using a automation constant,I should have used an activeX container.
• When i was initially looking for the control, I could not find it by browsing for items to put into the activeX container, so that is why i was using the constant. I think that unregistering and reregistering the control might have cause it to appear in that list. Not sure, as I can't go back in time and figure out if it was there or not.
2) Our printers are on a server, so just giving the printer name (or how it appears in your "Devices and Printers" control panel) is not appropriate, it has to be something like:
\\PrinterServer\PrinterName
Thank you for your help,
James
07-01-2014 09:38 AM
JamesEdward:
I'm triying to integrate a solidworks viewer into my labview app. But I can not find the control.
Did you remember the name of the control in the list? I have hundreds of them and the list is size-fixed.
Thank you!
07-01-2014 09:50 AM
I believe it was "EModelViewControl" or "IEModelViewControl". I can't be sure, because the VI that I looked in was made on my old laptop. I've since gotten a new laptop, but have not revisited this project, so I have not reinstalled this control.
I hope this is what you needed.
James
06-12-2019 09:46 PM
can you post your working code, please?