multi sheet browser name in i logic

multi sheet browser name in i logic

darrenwilliams
Explorer Explorer
415 Views
4 Replies
Message 1 of 5

multi sheet browser name in i logic

darrenwilliams
Explorer
Explorer

 hi 

 

I am trying to put multi sheets assembly together and using the sheet title in the browser to make it easy to see what parts are being used so we can open up just that drawing

I have found a code on this forum for naming the drawing sheet after the part drawn but when you add a second sheet with a different part it still calls it the after the first sheet part 

 

 

 

If (ThisDrawing.ModelDocument Is Nothing) Then Return
    modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
    ActiveSheet.Sheet.Name = iProperties.Value(modelName, "Project", "Description

any help would be great 

 

Darren

 

0 Likes
Accepted solutions (1)
416 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor

SyntaxEditor Code Snippet

For Each oSheet In ThisApplication.ActiveDocument.Sheets
    If oSheet.DrawingViews.Count = 0
         'Next Sheet
    Else
        oModelDoc = oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
        oProject = oModelDoc.PropertySets("Design Tracking Properties")("Project").Value
        If oProject <> ""
            oSheet.Name = oProject
        Else
            oSheet.Name = "xxx-NoProject"
        End If
    End If
Next

--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 5

darrenwilliams
Explorer
Explorer

Hi

 

Thanks for the quick reply on this 

 

This worked but put the project file as the sheet name i wanted to have the description of the parts as there will be different parts on each sheet 

 

Darren

0 Likes
Message 4 of 5

MechMachineMan
Advisor
Advisor
Accepted solution

I had misread your first code and saw project instead of description... Don't know why inventor words the property sets differently for iLogic... Smiley Indifferent

 

Also, for future reference:

http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html

 

For Each oSheet In ThisApplication.ActiveDocument.Sheets
    If oSheet.DrawingViews.Count = 0
         'Next Sheet
    Else
        oModelDoc = oSheet.DrawingViews.Item(1).ReferencedDocumentDescriptor.ReferencedDocument
        oDescription = oModelDoc.PropertySets("Design Tracking Properties")("Description").Value
        If oDescription <> "" 
oSheet.Name = oDescription
Else
oSheet.Name = "xxx-NoDescription"
End If
End If
Next

  


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
Message 5 of 5

darrenwilliams
Explorer
Explorer

Thanks very much this worked great 

0 Likes