jaepm.blogg.se

Document properties solidworks 2005
Document properties solidworks 2005





document properties solidworks 2005
  1. #DOCUMENT PROPERTIES SOLIDWORKS 2005 LICENSE KEY#
  2. #DOCUMENT PROPERTIES SOLIDWORKS 2005 WINDOWS#

When multiple properties need to be written or read, use Excel ranges to maximize the performance of the operationīatch updating 3 properties for multiple files GETSWPRP Reading description property from the Default configuration of the file

document properties solidworks 2005

Setting the value of the Product Id property Macro will add 2 functions into the Excel functions scope which can be used as any other function in ExcelĪs standard functions user can pass the parameter as reference to other cells. Note, depending on the size of the key you may see Compile error: Invalid outside procedure error error.

#DOCUMENT PROPERTIES SOLIDWORKS 2005 LICENSE KEY#

  • Modify the macro and enter the license key instead of the placeholder, retrieved in the first step.
  • Count - 1)Įrr.Raise vbError, "", "Value is not a Range" End If End Function SwDmConf.SetCustomProperty CStr(vNames(i)), CStr(vVals(i))Įnd If End Function Private Function RangeToArray(vRange As Variant) As Variant If TypeName(vRange) = "Range" Then Dim excelRange As rangeĭim i As Integer Dim valsArr() As String ReDim valsArr(excelRange.Cells. SwDmConf.AddCustomProperty CStr(vNames(i)), swDmCustomInfoText, CStr(vVals(i)) SwDmDoc.SetCustomProperty CStr(vNames(i)), CStr(vVals(i)) SwDmDoc.AddCustomProperty CStr(vNames(i)), swDmCustomInfoText, CStr(vVals(i)) Set swDmDoc = OpenDocument(swDmApp, fileName, False)ĭim i As Integer If confName = "" Then For i = 0 To UBound(vNames) either range or cell" End If Dim vNames As Variant Dim vVals As Variant If TypeName(prpNames) = "Range" ThenĮrr.Raise vbError, "", "Number of cells in the name and value are not equal" End If Else If TypeName(prpNames) TypeName(prpVals) ThenĮrr.Raise vbError, "", "Property name and value must be of the same type, e.g. Res(i) = swDmConf.GetCustomProperty( CStr(vNames(i)), prpType)Įrr.Raise vbError, "", "Failed to get configuration '" & confName & "' from '" & fileName & "'" End If End IfĮrr.Raise Err.Number, Err.Source, Err.DescriptionĮnd If End Function Public Function SETSWPRP(fileName As String, prpNames As Variant, prpVals As Variant, Optional confName As String = "") If Not swDmConf Is Nothing Then For i = 0 To UBound(vNames) Next Else Dim swDmConf As SwDocumentMgr.SwDMConfiguration10 Res(i) = swDmDoc.GetCustomProperty( CStr(vNames(i)), prpType) If confName = "" Then For i = 0 To UBound(vNames) Set swDmDoc = OpenDocument(swDmApp, fileName, True)ĭim res() As String Dim i As Integer ReDim res(UBound(vNames)) Error Code: " & openDocErrĮnd Function Public Function GETSWPRP(fileName As String, prpNames As Variant, Optional confName As String = "") As Variant Dim swDmApp As SwDocumentMgr.SwDMApplicationĭim swDmDoc As SwDocumentMgr.SwDMDocument10ĭim vNames As Variant If TypeName(prpNames) = "Range" Then Set swDmDoc = swDmApp.GetDocument(path, docType, readOnly, openDocErr)Įrr.Raise vbError, "", "Failed to open document: '" & path & "'. If Not swDmClassFactory Is Nothing Then Set swDmApp = swDmClassFactory.GetApplication(SW_DM_KEY)Įrr.Raise vbError, "", "Document Manager SDK is not installed" End If End Function Function OpenDocument(swDmApp As SwDocumentMgr.SwDMApplication, path As String, readOnly As Boolean) As SwDocumentMgr.SwDMDocument10Įxt = LCase(Right(path, Len(path) - InStrRev(path, ".")))Įrr.Raise vbError, "", "Unsupported file type: " & extĮnd Select Dim swDmDoc As SwDocumentMgr.SwDMDocument10 Set swDmClassFactory = CreateObject( "SwDocumentMgr.SwDMClassFactory") You can refer to this blog article for more information about that.Const SW_DM_KEY As String = "" Sub main()Įnd Sub Function ConnectToDm() As SwDocumentMgr.SwDMApplicationĭim swDmClassFactory As SwDocumentMgr.swDmClassFactoryĭim swDmApp As SwDocumentMgr.SwDMApplication The Custom Properties Tab Builder is another great way to add custom properties in this manner. True, they are populated with the same values, some of which may need to be manually changed, but this is far, far, faster than having to recreate the properties manually. Tadaa! All your custom properties now appear in the new file.
  • Paste the properties ( Ctrl+V) into the dialog.
  • Select the row header (where it says “1” on the left).
  • Delete all custom properties by Shift+selecting all row headers similar to step #2, and pressing Delete.
  • Open the new file and access the custom properties dialog.
  • Then give it the old Ctrl+C to copy it.
  • #DOCUMENT PROPERTIES SOLIDWORKS 2005 WINDOWS#

    You can also use Ctrl+select to select specific properties, just as you would in Windows Explorer or the SOLIDWORKS feature tree, or many other programs.

  • Then, select the list of custom properties from a source file by selecting the row header (where it says “1” on the left), then hold down the Shift key and select the last row (“4” in the example above).
  • First access the custom properties from File > Properties.
  • Custom Properties dialog: select the row “1” then hold shift and select row “4” The Copy & Paste Process







    Document properties solidworks 2005