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: 

.idw to .dwg iLogic Error

6 REPLIES 6
Reply
Message 1 of 7
mlatif
519 Views, 6 Replies

.idw to .dwg iLogic Error

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

6 REPLIES 6
Message 2 of 7
pcrawley
in reply to: mlatif

You don't give us much to go on.  

  • Inventor version?  
  • OS of your workstation and the Engineers workstation?
  • Internal rule or external?  
  • Path issue (c:\...\Username\Desktop)?
  • The error message?  What does "it doesn't work" actually mean - what are the symptoms (if any)?
Peter
Message 3 of 7
Yijiang.Cai
in reply to: mlatif

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?

Thanks,
River Cai

Inventor Quality Assurance Team
Autodesk, Inc.
Email: River-Yijiang.Cai@autodesk.com
Message 4 of 7
mlatif
in reply to: mlatif

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

 

 

 

Message 5 of 7
pcrawley
in reply to: mlatif

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.

Peter
Message 6 of 7
mlatif
in reply to: pcrawley

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.

Message 7 of 7
pcrawley
in reply to: mlatif

I know the forums are a free support mechanism, but you're not making it easy...Smiley Sad

 

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.

Peter

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

Post to forums  

Autodesk Design & Make Report