I'm fairly new to macros, but I'm trying to import a Parasolid file into an active document part file. I was trying loadfile4 at first but then I realised that it only opens the Parasolid as a new file, not into an existing one.
You are on the right track.
First, get the name of you active part for later use.(part1)
Then save the file you get via loadfile4 as a part.(part2)
Then activate part 1 again and use part2 into it : InsertPart3
(you can set the configuration you want, using "" will import the Default.)
You might need some clean up to do if you don't want to keep the temporary files.
but in this case I have to save the Parasolid as a solidworks part first right? I was hoping I could skip this step and have a macro that just imports the Parasolid straight to the active document.similar to the "imported" command
Interestingly LoadFile4 suppose to import into the active part as help doc says to import to new use "r" argument which implies that if it is not used it should import to this part. Anyways, here is another option to import directly to active doc: Macro to import foreign file into active part using SOLIDWORKS API
It worked perfectly mate, thanks!!
Retrieving data ...