NewBee Question on Adding Components w/ SW API

Hello - I am new to developing in SW API but have worked w/ACAD and others. I am trying to provide a dialog via an SW Add-INw/ a listing of SW components that the user can pick to insert intothe assembly. I can do the insert using the very rough code below,but end up w/ the component at a fixed location that I set inAddComponet4 - Ideally I would want my dialog to hide or disappearafter the user selects the component and then show SW w/ thecomponent anchored to the mouse, allowing the user to select thelocation. Is there a way to do this? I have tried selecting thecomponent after it has been inserted, and that is not working. Anyhelp would be great - Thanks in Advance! Scott


m_objiSwApp.DocumentVisible(false, intDocType);
m_objiSwApp.OpenDocSilent(strFilePath, intDocType, refintWarnings);

m_objiSwApp.ActivateDoc2("Assem1",true, ref intErrors);

SldWorks.IAssemblyDoc objAssemblyDoc;
objAssemblyDoc = (SldWorks.IAssemblyDoc)m_objiSwApp.ActiveDoc;

m_objiSwApp.DocumentVisible(true, intDocType);

SldWorks.Component2 swcomponent;
swcomponent = objAssemblyDoc.AddComponent4(strFilePath, "", -1, -1,-1);SolidworksApi macros