#1
|
|||
|
|||
visual studio and modeling
Hi,
Does somebody know how to connect visual studio 2013/2015 with Creo elements direct modeling 18.1? DDE doesn't exist anymore in visual studio. Somebody has an idea and/or example to do this? Thanks in advance |
#2
|
||||
|
||||
Re: visual studio and modeling
Sounds like an interesting project... what kind of integration are you looking for here?
Creo Elements/Direct Modeling provides full interop with COM (from Lisp), which may be exactly what you need in this case. Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
#3
|
|||
|
|||
Re: visual studio and modeling
I want to talk to Modeling from an outside application. So I want to make a visual menu with buttons in visual studio and those buttons "do something" in Modeling.
|
#4
|
||||
|
||||
Re: visual studio and modeling
What you are describing can indeed be accomplished using the COM/.NET API for Creo Elements/Direct Modeling. I feel a blog article coming up... ;-)
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ Last edited by clausb; 08-16-2015 at 05:21 AM. |
#5
|
|||
|
|||
Re: visual studio and modeling
Where can I find some information about the COM/.NET API from modeling? I'm not familiar with all of this.
|
#6
|
|||
|
|||
Re: visual studio and modeling
Hi,
I've just joined this forum for the same purpose. I would like to create a simple C++ external COM client to manage CoCreate assemblies/particular. What I want to do is something like: 1) open a CoCreate assembly; 2) write inside it some properties (string, int, double, date); 3) save the assembly; 4) close it; 5) open it again; 6) read the properties I've written at step #2; 7) save/export the assembly as PDF 8) close the assembly. By reading the CoCreate.OsdmObjects.chm document (provided during the software installation) I have issues at step #3. What object have I to use to save the current opened model/assy/particular? T&R, AB |
#7
|
|||
|
|||
Re: visual studio and modeling
Hi AtomicBee,
I never got it to work this COM link. What I do now is the following: I create a txt file in a temp folder and with cocreate I wait until there is a file in the temp folder. I read the file with lisp and then the cocreate actions can start. Where do you want to save the assembly in, do you work with windchill, model Manager or something else? Ruben |
#8
|
|||
|
|||
Re: visual studio and modeling
Hi, tanks for your reply!
I'm not working with any PLM system, just my C++ console application and PTC Creo Elements/Direct Modeling 19.0. Using both 'OsdmObjects.tlb' and 'OsdmServer.tlb' files and following the C++ example provided in the program SDK folder (obtained during the CAD Editor installation) I've implemented the following program. Code:
int _tmain(int argc, _TCHAR* argv[]) { cout << endl << "- - - Start testing CoCreate - - - - - - -" << endl << endl; ::CoInitialize(0); { CComPtr<CoCreate::Osdm::IApplication> pIAppl; CComPtr<CoCreate::Osdm::IDocument3D> pIDoc; // Remarks Currently, the only available document type is Document3D. CComPtr<CoCreate::Osdm::IComponent> pIComp; // Base object for all entities that can be nodes of the 3D model structure tree: Assembly, CoordinateSystem, Part, WorkPlane CComPtr<CoCreate::Osdm::IComponentArray> pICompArr; _bstr_t fileToOpen = "c:\\temp\\aaaaa.pkg"; // anything up to 13.20 HRESULT hr = ConnectToOsdm(CoCreate::ServerType_Any, "16.0", 0, 0, &pIAppl); if (FAILED(hr)) cout << "Not connected" << endl; else { cout << "Connected" << endl; pIAppl->LockUserInterface(); // to suspend the user editor interaction pICompArr = pIAppl->ILoadFile(fileToOpen); cout << "List of Components:" << endl; for (long int i = 0; i < pICompArr->Count; i++) { pIComp = pICompArr->GetItem(i); CoCreate::Osdm::LoadStatus s = pIComp->InqLoadStatus(); cout << "\t" << i << ") " << pIComp->GetName() << " - status: " << GetComponentStatus(s) << endl; } pIDoc= pIAppl->InqIActive3DDocument(); // here I would like to Save aaaaa.pkg as bbbbb.pkg // something like: pIDoc->Save("c:\\temp\\bbbbb.pkg"); pIAppl->UnlockUserInterface(); // to resume the user editor interaction } } ::CoUninitialize(); cout << endl << "- - - Test ends - - - - - - -" << endl; system("PAUSE"); return 0; } Any hint? T&R, AB |
#9
|
|||
|
|||
Re: visual studio and modeling
By reading some threads on this forum I incurred into this thread...
Here the user calls the Code:
Application->SendCommand() I think that this could be the key to solve my saving dilemma. Now my question is: where can I find a list of all available commands I can pass to the SendCommand() method? I mean, is there a booklet/web site/blog where all the available string commands are described? T&R, AB |
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests) | |
|
|