How about using CusProp Tab Builder which is inlcuded with SW?
what im trying to do is update the template to our new standard. So we have an old template which i need to replace with a new one that has already been made. I'm trying to do this with #Task (which runs a bunch of other macros to update our drawings to the new standard). So ideally if i can just make a macro that will just change the custom properties template to the new one
Sorry for confusing here : what you mean by template? You mean to replace a set of (current or old) custom properties to a new set of custom properties?
and what you want to change: Custom property name or only custom property value?
I have tried recording the macro by repeating the change several times but it doesnt seem to be working. Another user has said there is no API to access the template options for this.
My file location for the custom properties files is a server location where the rest of my workplace can access the templates.
You can not change the path of the property tab builder in a file as there are no API codes to do that
Do you just want to change the values of custom properties or the custom properties themselves in the drawing?
You might want to look at Custom Properties Manager task in #TASK
Here is the short demo video: http://cloud.ic3d.com.au.s3.amazonaws.com/sharp_task/videos/Sharptask_custo_prop_mgr.mp4
This task allows to add/set, rename, delete properties in a batch.
Please note that Add action will either add or set/change the property value (if it already exists).
Please be careful with batch operations! I would recommend to backup your data before running any batch operations.
Robert, there are currently no API to access to the Custom Property Tab Builder. So your only option is do those changes manually OR use API to just update the properties.
Please vote for SPR #:542212
Robert Havill - IMO it is always best to control the Custom Properties at the Part or Assembly level, having the Drawing Custom Properties override the Part/Assembly Custom Properties can get messy. Take a look at the attached macro that was written by Markku Lehtola - This macro will read every custom property that you list in a single folder, so it works well with parts and assemblies that are specific to a project. What you need to do is change or add the search path and change the custom properties that I have listed in each column.. This macro reads all the Custom Properties that you list and copies them into the spreadsheet, then you can change those values and feed it back to the part/assembly file..
SW_Import_Export Properties.xls 151.5 KB
Hello Robert Havill I have the same problem for a few years (since 2012) waiting for this obvious mistake to be repaired by the API support. Adding a property is not a problem, but the problem is when you want to edit it and you do not have a good user interface (New Task Pain Template with a new added property). And in fact, this concerns mainly the library parts (there is a lot of them). I have to go over 50,000 parts by hand. And it sucks.
Is that a custom property and same for all files? If yes then you can use SW Document Manager (you would have to request for the free key) and can add that property without opening the files.
And in case of configuration, you can a use a macro to add that.
You can also try this free and awesome tool called to batch add/update properties. #TASK
Thanks for the link to #TASK
Actually, I'd rather use a macro ...
But to better explain why I would like to change Task Pain Template with Macro. Our company supplies all over the world, and so we need multilingual documentation. See the preview on the picture.
Now imagine that we need documentation in Chinese or Russian language. In fact, you add a new property, but how do you define its value when you do not have a Chinese or a Russian keyboard. You need a list of values from which you just select a value (combo box)
Finally we are trying to solve this by using a macro that according to one property value finds and writes the others. But still when you need sth to change, it´s a problem. (You must copy from database and paste.) We try to avoid this doing it manually by using export xml from our 3DExperience database. The macro we are using is right here. I hope it can help someone.
Dim swApp As SldWorks.SldWorks
Dim swModel As SldWorks.ModelDoc2
Dim NazovSL As String
Dim NazovAN As String
Dim NazovNE As String
Dim NazovFR As String
Dim NazovRU As String
Set swApp = Application.SldWorks
Set swdoc = swApp.ActiveDoc
Set swConfigMgr = swdoc.ConfigurationManager
Set ActiveConfig = swConfigMgr.ActiveConfiguration
Set OpenDoc = swApp.ActiveDoc()
ActConfigName = ActiveConfig.Name
NazovSL = swdoc.GetCustomInfoValue(ActConfigName, "Nazov")
If NazovSL = "" Then
swApp.SendMsgToUser ("Zadaj Názov dielu! ")
ReadXml ("D:\#Kniznica_SolidWorks\_System\Názov Dielu.xml")
value = swdoc.DeleteCustomInfo2(ActConfigName, "NazovA")
value = swdoc.AddCustomInfo3(ActConfigName, "NazovA", swCustomInfoText, NazovAN)
value = swdoc.DeleteCustomInfo2(ActConfigName, "NazovN")
value = swdoc.AddCustomInfo3(ActConfigName, "NazovN", swCustomInfoText, NazovNE)
value = swdoc.DeleteCustomInfo2(ActConfigName, "NazovF")
value = swdoc.AddCustomInfo3(ActConfigName, "NazovF", swCustomInfoText, NazovFR)
value = swdoc.DeleteCustomInfo2(ActConfigName, "NazovR")
value = swdoc.AddCustomInfo3(ActConfigName, "NazovR", swCustomInfoText, NazovRU)
Private Sub ReadXml(ByVal Your_file)
Dim xmlDoc 'this is MSXML2.DOMDocument
Set xmlDoc = CreateObject("MSXML2.DOMDocument")
If Not xmlDoc.Load(Your_file) Then
Dim xmlNode 'this is a MSXML2.IXMLDOMElement
For Each xmlNode In xmlDoc.childNodes
Private Sub recurseNodes(ByVal xmlNode)
If xmlNode.hasChildNodes Then
For Each TheSubNode In xmlNode.childNodes
If TheSubNode.baseName = "Názov_x0020_Dielu" Then
If TheSubNode.childNodes.Item(1).text = NazovSL Then
NazovAN = TheSubNode.childNodes.Item(2).text
NazovFR = TheSubNode.childNodes.Item(3).text
NazovNE = TheSubNode.childNodes.Item(4).text
NazovRU = TheSubNode.childNodes.Item(5).text
You can set a kind of if condition in the property tab builder. What I mean is you can set the languages as the parent with either drop down or radio button selection. And then based on the selected languages, all the properties would should show.