iLogic error

iLogic error

Anonymous
Not applicable
3,429 Views
22 Replies
Message 1 of 23

iLogic error

Anonymous
Not applicable

Hello,

Can i ask you for help with iLogic?
I use iLogic rules to configure our products, and until 2018 it all worked.
I have used the same rules since the 2015 version and everything is ok. In the version 2018, I ceased to run a rule that has the task of tying the project name to all parts.
There is a lot of others involved in the rule, and that's why it's virtually nothing to do with this error.
Now I can not make orders and I am practically standing, which is why it burns a lot.

The rule is here:

 

 

Dim IPJ as String
Dim IPJ_Name As String
Dim IPJ_Path As String
Dim FNamePos As Long
'set a reference to the FileLocations object.
IPJ = ThisApplication.FileLocations.FileLocationsFile
'get the location of the last backslash seperator
FNamePos = InStrRev(IPJ, "\", -1)    
'get the project file name with the file extension
IPJ_Name = Right(IPJ, Len(IPJ) - FNamePos)
'get the project name (without extension)
'IPJ_ShortName = Left(IPJ_Name, Len(IPJ_Name) - 4)
'get the path of the folder containing the project file
IPJ_Folder_Location = Left(IPJ, Len(IPJ) - Len(IPJ_Name))

Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
'oAsmName = Left(oAsmDoc.DisplayName, Len(oAsmDoc.DisplayName) -4)
oAsmName = Left(IPJ_Name, Len(IPJ_Name) - 4)

Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document

Dim i As Integer
i=1

For Each oRefDoc In oRefDocs
        oRefDocs.Item(i).PropertySets.Item("Inventor Summary Information").Item("Title").Value=oAsmName
        i=i+1    
Next

iProperties.Value("Summary", "Title") = oAsmName

ThisDoc.Save

 


We found out that this rule throws out this error when it writes to standard parts. Until 2018 there was no problem.

Many thanks,

Daniel Zdenek

0 Likes
3,430 Views
22 Replies
Replies (22)
Message 21 of 23

MechMachineMan
Advisor
Advisor

The line has not worked for me with both documents close and documents opened.

 

Running both of these variations without a document open, and through the VBA environment gives errors for both, but I can clearly see the property exists (in build 227).

 

ThisApplication.LibraryDocumentModifiable = True

is followed by a runtime error 438; Method or property not found on object.

 

 

ThisApplication._LibraryDocumentModifiable = True

is followed by an "Invalid character" error.


--------------------------------------
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 22 of 23

MjDeck
Autodesk
Autodesk

In VBA, you have to use:
ThisApplication.[_LibraryDocumentModifiable] = True

That also works in iLogic.


Mike Deck
Software Developer
Autodesk, Inc.

Message 23 of 23

NPieper
Participant
Participant

With Inventor 2018 Update 2 the following works:

 

dynamic ap = Inventor.Application;   // Because referenced older api.

ap._LibraryDocumentModifiable = true;

 

For setting iProperties on library files (content center) with an addin.

 

 

0 Likes