iLogic Error - On 2nd PC

iLogic Error - On 2nd PC

Anonymous
Not applicable
441 Views
3 Replies
Message 1 of 4

iLogic Error - On 2nd PC

Anonymous
Not applicable

I have this iLogic rule that picks up the File name a custom properties. And this works fine on my PC, but it is not working a different PC with the same template files and ilogic rule, any body know why? 

 

Rule Below:

 

SyntaxEditor Code Snippet

Sub Main()
'Purpose: Push file name to sheet name'21-Sept-16

Dim oDoc As Document = ThisApplication.ActiveDocument
Dim oSheet As Sheet
Dim oDrawingView As DrawingView

'Iterate through sheets
For Each oSheet In oDoc.Sheets
    'Grab the first drawing view on the sheet
    oDrawingView = oSheet.DrawingViews(1)

    'Grab the model of the first drawing view
    oModel = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument 

    'Grab the custom iproperty of the first drawing view model
    oModel1 = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName
    o_iProp = iProperties.Value(oModel1, "Custom", "RevisionUK")  

    'set sheet name to filename and custom iprop from model
    oSheet.Name = System.IO.Path.GetFileNameWithoutExtension(oModel.FullFileName)& " - " & o_iProp


Next 

End Sub

 

Error Message

 

Error.png

 

 

0 Likes
442 Views
3 Replies
Replies (3)
Message 2 of 4

MechMachineMan
Advisor
Advisor

Might be a long shot, but try making sure your window "Hide known file extensions" setting is the same.

 

Otherwise, it might be if there is a different O/S?

 

Could also be some iLogic settings or something.


--------------------------------------
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 4

Anonymous
Not applicable

where do i find this setting?

0 Likes
Message 4 of 4

Martin-Winkler-Consulting
Advisor
Advisor

HI @Anonymous

for debugging the reason you can use  MsgBox to look wether the path and name is fine.

 

 'set sheet name to filename and custom iprop from model
MsgBox(oModel.FullFileName)
MsgBox(System.IO.Path.GetFileNameWithoutExtension(oModel.FullFileName)) oSheet.Name = System.IO.Path.GetFileNameWithoutExtension(oModel.FullFileName)& " - " & o_iProp

Martin Winkler
CAD Developer
Did you find this post helpful? Feel free to like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


EESignature

0 Likes