Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Catia VBA / Macro Copy Image capture not capture to file

Status
Not open for further replies.

ubengineer

Aerospace
May 8, 2014
12
US
thread560-351508

I am trying to write a macro to
Step 1: capture a image in catia (Tools-Image-Capture-Capture(record icon)-Copy) and Copy it (Copy to clipboard) and then
step 2: open a excel file and past then ...

I can not get step 1. I have found posts that show how to capture to file, do a screen shot through windows but those do not help. I did find a post ( )that Ferdo replied to saying that one exists and do a search in that forum but I had no luck locating that post. Can someone PLEASE help me with having a macro do a copy of an image and not a caturetofile.
 
Replies continue below

Recommended for you

yes I saw both of these.
Thread1:
This one doesnt do what im looking for. this one takes catia drawing saves that are images and imports them into power point
thread2: this one is performing the right task but not in the way I want. This thread (which I tested) save it to a file then imports it into ppt

Im looking for the macro not to save to a file but to perform a copy (Copy to clipboard) so I can then past it into excel. (ppt and excel I know are the same thing) its the copy vs Saving the image that is why that thread is not what im looking for. I tried doing a macro record and nothing records, so that didnt help. I would insert a picture if I knew how the picture option is asking for a URL
 
I wanted it to perform a copy (to clipboard)and not a save to a pic file.
 
Because I want to make a macro button and have multiple users be able to use it. By doing a save I need to then change the location for each user.
 
ok. this may be a question for a different thread but if I do, do the file I would like to do the following but have not had any luck with either. oping with your expertiese you can help;
1) pass a variable, such as file location, from a module to a userform. I know hot to go from Userform to module just but I dont know how to do other way
around.
Module1:
picfile="\\folder\folder\folder\OBMSectionR1.emf"
UserForm1:
Set Image1.Picture = LoadPicture(picfile)

2)set the file location as a variable to be used in CaptureToFile eg.
Module1:
picfile="\\folder\folder\folder\OBMSectionR1.emf"
CATIA.ActiveWindow.Viewers.Item(1).CaptureToFile 1, picfile.Name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Top