Autodesk Inventor Customization
- Start Article
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi
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
End If
Next
'How to replace oldstyle with newstyle
'oldstyle = Newstyle
End If
Next
René J
Re: Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Chris
Re: Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
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.
Inventor Applications Engineer
Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Re: Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
UGHHHH....I swear I read "parts list style" the first time I read your post! Thats what I get for responding before I've had some caffeine!
Re: Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Get some coffee, it will be alright - for a Friday ![]()
Inventor Applications Engineer
Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Re: Replace styles in Drawing
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Thanks Jonathan
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.
René J
