Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IV10Sp3a - Is there a way to set a default sort to the Partslist in an idw?

7 REPLIES 7
Reply
Message 1 of 8
Anonymous
181 Views, 7 Replies

IV10Sp3a - Is there a way to set a default sort to the Partslist in an idw?

When I we insert a partslist in an idw we always sort by vendor and then by part number. Is there any way to have the sort as a default when a partlist is inserted?

Pete
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: Anonymous

Don't think so, but I think there is a wish for this at the current AUGI
voting cycle...

pkquat wrote:
> When I we insert a partslist in an idw we always sort by vendor and then by part number. Is there any way to have the sort as a default when a partlist is inserted?
>
> Pete
Message 3 of 8
Anonymous
in reply to: Anonymous

Short of exporting the BOM to Excel and doing the sorts there and then
linking/embedding the file back to your IDW. It won't be clean-cut and self
updating.

--
Dell 670 dual Xeon - 3.2
3gb memory, SCSI320-15k
XP-Pro, sp2
FX3400: Driver: 91.85
IV2008, SpacePilot 3.3.2

"Troy Grose" wrote in message
news:5625293@discussion.autodesk.com...
Don't think so, but I think there is a wish for this at the current AUGI
voting cycle...

pkquat wrote:
> When I we insert a partslist in an idw we always sort by vendor and then
> by part number. Is there any way to have the sort as a default when a
> partlist is inserted?
>
> Pete
Message 4 of 8
Anonymous
in reply to: Anonymous

I just made a macro for doing this and put a button for it on my drawing toolbar. Like Blair said, it is not self-updating, but if you went to the trouble to make an Add-in, you could make the Parts List sort itself OnSave.

---------------------------------------------------------------------------



Public Function GetActiveDrawing() As DrawingDocument

If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
Set GetActiveDrawing = ThisApplication.ActiveDocument
Else
MsgBox "Must have a drawing active", vbOKOnly, "Error"
End If

End Function



Public Function GetSelectedPartsList() As PartsList

Dim oDrawDoc As DrawingDocument
Set oDrawDoc = GetActiveDrawing
If oDrawDoc Is Nothing Then Exit Function

Dim oSelectSet As SelectSet
Set oSelectSet = oDrawDoc.SelectSet

If oSelectSet.Count = 0 Then Exit Function
If oSelectSet.Item(1).Type <> kPartsListObject Then Exit Function
Set GetSelectedPartsList = oSelectSet.Item(1)

End Function




Public Function FormatPartsList(oPartsList As PartsList) As PartsList

On Error Resume Next
oPartsList.Sort "SUB-ASSEMBLY", False, "MATERIAL NAME", True, "PART NUMBER", True
oPartsList.Renumber
If Err Then
Err.Clear
MsgBox "Could not sort Parts List", , "Error"
End If

Set FormatPartsList = oPartsList

End Function



Public Sub FormatSelectedPartsList()

Dim oPartsList As PartsList
Set oPartsList = GetSelectedPartsList
If oPartsList Is Nothing Then Exit Sub

FormatPartsList oPartsList

End Sub Message was edited by: Josh_Petitt
Message 5 of 8
Anonymous
in reply to: Anonymous

WOW! Thanks! A button click is close enough to a default.

Two questions - how did you link the macro to a button, and where do you store the macro?

We are just getting into macros and have a few for some basic tasks and printing tasks, but so far we haven't found how to auto load them or link them to a button.

Pete
Message 6 of 8
Anonymous
in reply to: Anonymous

put the macro in your default .ivb. Go to Inventor, and RMB on a toolbar where there is empty space and no buttons. A menu should appear with Customize... Click Customize and the customize dialog will appear. Select the Commands tab, select Macros in Categories on the left hand side. A list of available macros should appear on the right hand side. RMB and drag the macro you want to the toolbar. You have to do this in the drawing environment panel you want (there is the view panel and the annotation panel).

Note that FormatSelectedPartsList is the only Sub, so it is the macro you want to make a button from.
Message 7 of 8
Anonymous
in reply to: Anonymous

Ok so it has to be in the default.ivb.

I had thought there was a way to have macros outside of the default.ivb that can be loaded (but I hadn't found that yet, this might explain why).

For some of our macros (we are still learning and testing some) we may have to investigate making them an addin for some users.

Thanks again

Pete
Message 8 of 8
Anonymous
in reply to: Anonymous

One other question in playing with the macro. I am assuming the Partslist has to be selected. That is the only way I can get ti work properly. I am still a noob at this, but is the

Public Function GetSelectedPartsList() As PartsList

routine supposed to select the parts list or is that only checking if it already is selected?

Also do you know if there is a way to turn off visibility of parts if the vendor or other item is set to a specific value? (Its variations like this where I think of having them as separate macros with separate buttons) I will have to play more with subs so I can create variations of macros in the same ivb.

Pete

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report