Inventor Customization

Reply
Contributor
Posts: 11
Registered: ‎04-09-2003
Message 1 of 5 (435 Views)

I want to create an ilogic rule for an idw that is triggered when a iam is used

435 Views, 4 Replies
01-10-2013 08:56 AM

 My company has a standard that when the drawing is detailing an assembly it uses one style of BOM, and when we use a weldment it uses a different BOM. Is there a way to have an ilogic rule work when an assembly file is used it can trigger the specific BOM to use. I would like this so that a user doesn't really have to think as to which BOM to use.

 

Any help would be great.

 

Using Inventor 2013

*Expert Elite*
Curtis_Waguespack
Posts: 2,566
Registered: ‎03-08-2006
Message 2 of 5 (430 Views)

Re: I want to create an ilogic rule for an idw that is triggered when a iam is u

01-10-2013 09:48 AM in reply to: dionm

Hi dionm,

 

Do you mean BOM style as in the XML file used in the Assembly, or are you referring to a Parts List style in the Drawing?

 

I'm not sure I have a solution in either case, but it might help to clarify this for someone else who reads this.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





Contributor
Posts: 11
Registered: ‎04-09-2003
Message 3 of 5 (424 Views)

Re: I want to create an ilogic rule for an idw that is triggered when a iam is u

01-10-2013 10:31 AM in reply to: dionm

I'm refering to the "Parts List" in the idw.

*Expert Elite*
Curtis_Waguespack
Posts: 2,566
Registered: ‎03-08-2006
Message 4 of 5 (412 Views)

Re: I want to create an ilogic rule for an idw that is triggered when a iam is u

01-10-2013 02:56 PM in reply to: dionm

Hi dionm,

You can try this example, but I'm not getting it to work completely. I can't recall if we can set the parts list style with the API or not (I'm thinking we can not.) I've run out of time to look at this, but thought I'd post what I had in case it helps.

 

This link is related and provides another possiblity (switching the object default):

http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/Replace-styles-in-Drawing/td-p/3594108...

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

' This assumes a drawing document is active.
Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.
Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the first drawing view on the sheet. Assumes it’s not a draft view.
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
‘define the insert point
Dim oPlacementPoint As Point2d
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d (27.8130#, 21.463#)
' Create the parts list.
oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint)

'check to see if the referenced file is a weldment
oModelDoc = ThisDoc.ModelDocument
If oModelDoc.SubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then
'set parts list to a specific style for weldments
oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("Weldment Parts List")
Else
'set parts list to a specific style for standard assemblies
oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("Standard Parts List")
End if

 



  solution.png  Did you find this reply helpful ? If so please use the Accept as Solution or  Kudos button below.





ADN Support Specialist
xiaodong.liang
Posts: 1,190
Registered: ‎06-12-2011
Message 5 of 5 (369 Views)

Re: I want to create an ilogic rule for an idw that is triggered when a iam is u

01-17-2013 11:04 PM in reply to: Curtis_Waguespack

Hi,

 

I think 

Sub Main()

' This assumes a drawing document is active.Dim oDrawDoc As DrawingDocument
oDrawDoc = ThisApplication.ActiveDocument
'Set a reference to the active sheet.Dim oSheet As Sheet
oSheet = oDrawDoc.ActiveSheet
' Set a reference to the first drawing view on the sheet. Assumes it's not a draft view.Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
'define the insert pointDim oPlacementPoint As Point2d
oPlacementPoint = ThisApplication.TransientGeometry.CreatePoint2d (27.8130#, 21.463#)
' Create the parts list.oPartsList = oSheet.PartsLists.Add(oDrawingView, oPlacementPoint)

'check to see if the referenced file is a weldmentDim oStyle As PartsListStyle
oModelDoc = ThisDoc.ModelDocument
If oModelDoc.SubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then
'set parts list to a specific style for weldments
'oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("Weldment Parts List")  oStyle = PartsListStyle(oDrawDoc, "Weldment Parts List")
  If Not oStyle Is Nothing Then
     oPartsList.Style = oStyle
  End If
Else
'set parts list to a specific style for standard assemblies
'oPartsList.Style = oDrawDoc.StylesManager.PartsListStyles.Item("Parts List (Ansi)")
 oStyle = PartsListStyle(oDrawDoc, "Parts List (Ansi)")
  If Not oStyle Is Nothing Then
     oPartsList.Style = oStyle
  End If
  
End If
End Sub

Function PartsListStyle(oDoc As DrawingDocument, stylename As String ) As PartsList

   PartsListStyle =Nothing
   Dim oEachStyle As PartsListStyle
   For Each oEachStyle In oDoc.StylesManager.PartsListStyles  
      If oEachStyle.Name = stylename Then
        PartsListStyle = oEachStyle
        Exit Function
      End If
   Next
   
End Function




Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube