I have an iLogic code that turns an .idw into a DWG and then punches it out to a folder on the desktop. I've never had an issue with this code except it doesn't work on one engineer's computer. Does anyone have an inclination why this would be occuring? I figured the reason was something to do with the settings on his computer/Inventor but I haven't been able to figure out anything to confirm or deny that theory. Any help would e appreciated.
Thank you for your time,
Mehran Latif
You don't give us much to go on.
Maybe it is caused by the permission level when writing output file in folder within OS disk. Anyway, could you provide the iLogic rule here for investigation?
Sorry for the awkward post; I'm not very good at formatting these. We have Windows 7 on both the workstations and there is no error message that comes up. I have the output folder set to Public instead of username so I feel like it should show up since it has never been a problem on the other computers I tried it on. It is an External Rule.
oFolder = "C:\Users\Public\Desktop\Release" oFolderSheet = "C:\Users\Public\Desktop\Outside Services" 'Check for the PDF folder and create it if it does not exist If Not System.IO.Directory.Exists(oFolder) Then System.IO.Directory.CreateDirectory(oFolder) End If If Not System.IO.Directory.Exists(oFolderSheet) Then System.IO.Directory.CreateDirectory(oFolderSheet) End If Else If (oOccurrence.Definition.Type = 150995200) Then idwPathName = Left(CurFileName, Len(CurFileName) - 3) & "idw" 'check to see that the model has a drawing of the same path and name If(System.IO.File.Exists(idwPathName)) Then Dim DWGAddIn As TranslatorAddIn DWGAddIn = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC4-122E-11D5-8E91-0010B541CD80}") Dim oDrawDoc As DrawingDocument oDrawDoc = ThisApplication.Documents.Open(idwPathName, False) On Error Resume Next oDataMedium.FileName = oFolderSheet & "\" & ShortName & ".dwg" 'Write out the PDF Call DWGAddIn.SaveCopyAs(oDrawDoc, oContext, oOptions, oDataMedium) 'close the file oDrawDoc.Close Else End If
Are you sure this is your current rule? The reason I ask is that this won't work at all - on any machine.
There are a few errors, e.g. Here:
If Not System.IO.Directory.Exists(oFolderSheet) Then
System.IO.Directory.CreateDirectory(oFolderSheet)
End If
Else If (oOccurrence.Definition.Type = 150995200) Then
The Else If above isn't contained within an If...End If loop, so it'll throw an error. It looks like it belongs to a higher loop somewhere that you haven't posted.
In the line If (oOccurrence.Definition.Type = 150995200) Then you have not declared oOccurrence.
There is a stray Else at the end of your code. (Not a real problem, just odd.)
Those are a few problems I can see without running the code.
Since iLogic does not yet have a debug environment, I would suggest you get the correct code and insert a few MessageBox.Show("Check point 1", "iLogic") statements in it (incrementing the number so you know where you are.) Put one in each of the If / End If statements so you can see them running, then one in where you create the DWG and another in where you create the PDF. Now you'll have code that prompts you as it runs, and hopefully you can find the point where it fails.
That is just a snippet of the overall code I have. It is the part I'm trying to get to work and it punches out to the right folder on two computers but not the third so I was wondering if it was some sort of permission error and how I could fix that.
I know the forums are a free support mechanism, but you're not making it easy...
What makes you think it's a permissions issue?
Try the suggestion above:
Since iLogic does not yet have a debug environment, I would suggest you get the correct code and insert a few MessageBox.Show("Check point 1", "iLogic") statements in it (incrementing the number so you know where you are.) Put one in each of the If / End If statements so you can see them running, then one in where you create the DWG and another in where you create the PDF. Now you'll have code that prompts you as it runs, and hopefully you can find the point where it fails.