I have some styles I will like to replace in some drawings
but how? I cant find any function to do this.
Do I missing some thing ?
Dim oIDWStyles As Inventor.DrawingStylesManager
Set oIDWStyles = oDrawDoc.StylesManager
Dim oldstyle As style
Dim Newstyle As style
For Each oldstyle In oIDWStyles.Styles
If oldstyle.Name = "Old style" Then
' Debug.Print oldstyle.Name & " : " & oldstyle.InternalName
For Each Newstyle In oIDWStyles.Styles
If Newstyle.Name = "New style" Then
'Debug.Print Newstyle.Name & " : " & Newstyle.InternalName
'How to replace oldstyle with newstyle
'oldstyle = Newstyle
This worked for me:
' Create the parts list and set a reference to it.
Dim oPartsList As PartsList
Set oPartsList = oSheet.PartsLists.Add(oDrawingView1, oPlacementPoint)
oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("PARTS LIST PART")
Hope this helps.
You can rename it, delete it, set another style as the object default, but no direct replace that I know of.
If you set the new styles as object defaults, then you could change all elements to the active standard.
Get some coffee, it will be alright - for a Friday
Finally I got the time, to look at your suggestion.
I'm sorry I have not commented earlier, I've been on vacation.
I thought there was an easier solution.
Access a broad range of knowledge to help get the most out of your products and services.
Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.
Upgrading to a 2015 product? Make sure to check these out 1st!