PDM macro(?) saveas all virtual components at once

Discuss SolidWorks PDM
User avatar
mp3-250
Posts: 631
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 706
x 347

PDM macro(?) saveas all virtual components at once

Unread post by mp3-250 »

We have a workflowf for routing design that uses temporary virtual (internal) components during the early design phase, but in the end we need to save each component as an extenal independent 3D data.
the current workflow is to select every single components and saveas from the tree.

it takes a lot of time and it would be better to have a sort of dialog to allow multiple save operatation at once, with the possibility to quickly copy and paste filenames or replace strings lIke copy/move tree dialog in pdm.

I was wondering if it would be possible with a macro adding an automatic check in would help. saving time as well.
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 881

Re: PDM macro(?) saveas all virtual components at once

Unread post by JSculley »

Yes it is possible. You could go a step further and create a PDM add-in that does all of this in response to one or more of these events:

Code: Select all

EdmCmd_CardButton 37 = The user clicked either OK or a button whose command is enclosed in brackets ("<...>") in the file data card 
EdmCmd_CardInput 38 = The user modified a value in a file or folder data card 
EdmCmd_CardListSrc 39 = The add-in should provide a list that is used in a card 
EdmCmd_InstallAddIn 23 = The add-in is being installed 
EdmCmd_Menu 1 = User clicked a menu command or a toolbar button that was created by the add-in 
EdmCmd_PostAdd 12 = One or more files were added to the file vault 
EdmCmd_PostAddFolder 28 = One or more folders were added to the file vault 
EdmCmd_PostCopy 20 = One or more files were copied to a new folder 
EdmCmd_PostCopyFolder 36 = One or more folders were copied to a new parent folder 
EdmCmd_PostDelete 14 = One or more files have been deleted 
EdmCmd_PostDeleteFolder 30 = One or more folders were deleted from the file vault 
EdmCmd_PostGet 26 = One or more files were copied from the archive to the local hard disk 
EdmCmd_PostLabel 47 = A label has been created 
EdmCmd_PostLabelAddItem 53 = A label has gotten a file or folder added to it 
EdmCmd_PostLabelDelete 49 = A label has been deleted 
EdmCmd_PostLabelModify 51 = A label has been renamed or gotten its comment updated 
EdmCmd_PostLock 4 = One or more files have been checked out 
EdmCmd_PostMove 22 = One or more files were moved to a new folder 
EdmCmd_PostMoveFolder 34 = One or more folders were moved to a new parent folder 
EdmCmd_PostRename 16 = One or more files were renamed 
EdmCmd_PostRenameFolder 32 = One or more folders were renamed 
EdmCmd_PostShare 18 = One or more files were shared to a new folder 
EdmCmd_PostState 10 = One or more files had their states changed 
EdmCmd_PostUndoLock 8 = One or more files had their locks removed without any changes sent to the file vault 
EdmCmd_PostUnlock 6 = One or more files have been checked in 
EdmCmd_PreAdd 11 = One or more files are about to be added to the file vault 
EdmCmd_PreAddFolder 27 = One or more folders are about to be added to the file vault 
EdmCmd_PreCopy 19 = One or more files are about to be copied to a new folder 
EdmCmd_PreCopyFolder 35 = One or more folders are about to be copied to a new parent folder 
EdmCmd_PreDelete 13 = One or more files are about to be deleted 
EdmCmd_PreDeleteFolder 29 = One or more folders are about to be deleted from the file vault 
EdmCmd_PreGet 25 = One or more files are about to be copied from the archive to the local hard disk 
EdmCmd_PreLabel 46 = A label is about to be created 
EdmCmd_PreLabelAddItem 52 = A label is about to get a file or folder added to it 
EdmCmd_PreLabelDelete 48 = A label is about to be deleted 
EdmCmd_PreLabelModify 50 = A label is about to be renamed or get its comment updated 
EdmCmd_PreLock 3 = One or more files are about to be checked out 
EdmCmd_PreMove 21 = One or more files are about to be moved to a new folder 
EdmCmd_PreMoveFolder 33 = One or more folders are about to be moved to a new parent folder 
EdmCmd_PreRename 15 = One or more files are about to be renamed 
EdmCmd_PreRenameFolder 31 = One or more folders are about to be renamed 
EdmCmd_PreShare 17 = One or more files are about to be shared to a new folder 
EdmCmd_PreState 9 = One or more files are about to have their states changed 
EdmCmd_PreUndoLock 7 = One or more files are about to get their locks removed without any changes sent to the file vault 
EdmCmd_PreUnlock 5 = One or more files are about to be checked in 
EdmCmd_SerialNo 2 = The add-in should generate a new serial number 
EdmCmd_TaskDetails 42 = Use this hook to add your own custom page to the task details dialog box in the task list 
EdmCmd_TaskLaunch 44 = The task is being launched; add your own user interface to permit user input 
EdmCmd_TaskLaunchButton 45 = OK or Cancel was clicked in the task launch dialog box 
EdmCmd_TaskRun 43 = This hook is called on the task server; you should perform the actual work there 
EdmCmd_TaskSetup 40 = Use this hook to add a task setup page to a task properties dialog box wizard 
EdmCmd_TaskSetupButton 41 = OK or Cancel was clicked in the task properties dialog box wizard 
EdmCmd_UninstallAddIn 24 = The add-in is about to be uninstalled 
User avatar
mp3-250
Posts: 631
Joined: Tue Sep 28, 2021 4:09 am
Answers: 20
Location: Japan
x 706
x 347

Re: PDM macro(?) saveas all virtual components at once

Unread post by mp3-250 »

JSculley wrote: Wed Apr 05, 2023 1:53 pm Yes it is possible. You could go a step further and create a PDM add-in that does all of this in response to one or more of these events:

Code: Select all

EdmCmd_CardButton 37 = The user clicked either OK or a button whose command is enclosed in brackets ("<...>") in the file data card 
EdmCmd_CardInput 38 = The user modified a value in a file or folder data card 
EdmCmd_CardListSrc 39 = The add-in should provide a list that is used in a card 
EdmCmd_InstallAddIn 23 = The add-in is being installed 
EdmCmd_Menu 1 = User clicked a menu command or a toolbar button that was created by the add-in 
EdmCmd_PostAdd 12 = One or more files were added to the file vault 
EdmCmd_PostAddFolder 28 = One or more folders were added to the file vault 
EdmCmd_PostCopy 20 = One or more files were copied to a new folder 
EdmCmd_PostCopyFolder 36 = One or more folders were copied to a new parent folder 
EdmCmd_PostDelete 14 = One or more files have been deleted 
EdmCmd_PostDeleteFolder 30 = One or more folders were deleted from the file vault 
EdmCmd_PostGet 26 = One or more files were copied from the archive to the local hard disk 
EdmCmd_PostLabel 47 = A label has been created 
EdmCmd_PostLabelAddItem 53 = A label has gotten a file or folder added to it 
EdmCmd_PostLabelDelete 49 = A label has been deleted 
EdmCmd_PostLabelModify 51 = A label has been renamed or gotten its comment updated 
EdmCmd_PostLock 4 = One or more files have been checked out 
EdmCmd_PostMove 22 = One or more files were moved to a new folder 
EdmCmd_PostMoveFolder 34 = One or more folders were moved to a new parent folder 
EdmCmd_PostRename 16 = One or more files were renamed 
EdmCmd_PostRenameFolder 32 = One or more folders were renamed 
EdmCmd_PostShare 18 = One or more files were shared to a new folder 
EdmCmd_PostState 10 = One or more files had their states changed 
EdmCmd_PostUndoLock 8 = One or more files had their locks removed without any changes sent to the file vault 
EdmCmd_PostUnlock 6 = One or more files have been checked in 
EdmCmd_PreAdd 11 = One or more files are about to be added to the file vault 
EdmCmd_PreAddFolder 27 = One or more folders are about to be added to the file vault 
EdmCmd_PreCopy 19 = One or more files are about to be copied to a new folder 
EdmCmd_PreCopyFolder 35 = One or more folders are about to be copied to a new parent folder 
EdmCmd_PreDelete 13 = One or more files are about to be deleted 
EdmCmd_PreDeleteFolder 29 = One or more folders are about to be deleted from the file vault 
EdmCmd_PreGet 25 = One or more files are about to be copied from the archive to the local hard disk 
EdmCmd_PreLabel 46 = A label is about to be created 
EdmCmd_PreLabelAddItem 52 = A label is about to get a file or folder added to it 
EdmCmd_PreLabelDelete 48 = A label is about to be deleted 
EdmCmd_PreLabelModify 50 = A label is about to be renamed or get its comment updated 
EdmCmd_PreLock 3 = One or more files are about to be checked out 
EdmCmd_PreMove 21 = One or more files are about to be moved to a new folder 
EdmCmd_PreMoveFolder 33 = One or more folders are about to be moved to a new parent folder 
EdmCmd_PreRename 15 = One or more files are about to be renamed 
EdmCmd_PreRenameFolder 31 = One or more folders are about to be renamed 
EdmCmd_PreShare 17 = One or more files are about to be shared to a new folder 
EdmCmd_PreState 9 = One or more files are about to have their states changed 
EdmCmd_PreUndoLock 7 = One or more files are about to get their locks removed without any changes sent to the file vault 
EdmCmd_PreUnlock 5 = One or more files are about to be checked in 
EdmCmd_SerialNo 2 = The add-in should generate a new serial number 
EdmCmd_TaskDetails 42 = Use this hook to add your own custom page to the task details dialog box in the task list 
EdmCmd_TaskLaunch 44 = The task is being launched; add your own user interface to permit user input 
EdmCmd_TaskLaunchButton 45 = OK or Cancel was clicked in the task launch dialog box 
EdmCmd_TaskRun 43 = This hook is called on the task server; you should perform the actual work there 
EdmCmd_TaskSetup 40 = Use this hook to add a task setup page to a task properties dialog box wizard 
EdmCmd_TaskSetupButton 41 = OK or Cancel was clicked in the task properties dialog box wizard 
EdmCmd_UninstallAddIn 24 = The add-in is about to be uninstalled 
Could you elaborate a bit more?
Like where do those events come from?

I do not know where to start as I have no real experience in macro for SW. I can manage scripts and code snippets to a certain extent, but writing a macro like that from scratch could be a bit too ambitious, at least in term of messing the PDM up.
User avatar
JSculley
Posts: 648
Joined: Tue May 04, 2021 7:28 am
Answers: 55
x 9
x 881

Re: PDM macro(?) saveas all virtual components at once

Unread post by JSculley »

Post Reply