Adding component to a new assembly document
Adding component to a new assembly document
(OP)
Hi!
I create a new assembly doc (from my C++ program) and I like adding by assembly component to it.
But don't work...
I like the adding the component to the assembly by the
AddComponent4() function.
The function result:
hres = S_OK (it's good) but a pointer to the component is NULL (variable name of program: swComp). It is bad.
My codesnippet:
IComponent2* swComp;
CComQIPtr <IAssemblyDoc> swAssy = swModel;
hres = swAssy -> AddComponent4(component_name, "", x, y, z, &swComp);
Why???
Can anybody a idea? (swAssy is correct too...)
(Sorry the my C++ example, but I not working properly in VB...)
Thanks:
ZsZs.
I create a new assembly doc (from my C++ program) and I like adding by assembly component to it.
But don't work...
I like the adding the component to the assembly by the
AddComponent4() function.
The function result:
hres = S_OK (it's good) but a pointer to the component is NULL (variable name of program: swComp). It is bad.
My codesnippet:
IComponent2* swComp;
CComQIPtr <IAssemblyDoc> swAssy = swModel;
hres = swAssy -> AddComponent4(component_name, "", x, y, z, &swComp);
Why???
Can anybody a idea? (swAssy is correct too...)
(Sorry the my C++ example, but I not working properly in VB...)
Thanks:
ZsZs.






RE: Adding component to a new assembly document
Eric
RE: Adding component to a new assembly document
Before I'm searching the web, and found a link:
http://2
There is wrote also the firs possible solution the using the OpenDoc6().
The second chance the using the IAddComponents2() functions.
(It is possible quickly? - not explicit open... or the backgound open effecting equal speed? - I don't know...)
Now, but I big problem with this method that have the in the source a declaration:
LPCOMPONENT swCompArr[2] = {NULL, NULL};
My compiler (Visual C++ 6.0 Pro) not found the LPCOMPONENT type, and write a error message for me. Where is it? Which include file? Or what do it the variable?
I not found the type between the C++ header files, I belive it is a Solidworks API type... or not?
(In the Solidworks API help, by the IAddComponent2, only C++ example...)
Thanks your suggestions!
ZsZs.
RE: Adding component to a new assembly document
RE: Adding component to a new assembly document