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: 

Rule doesn't work

3 REPLIES 3
Reply
Message 1 of 4
stannm
236 Views, 3 Replies

Rule doesn't work

Hello,

 

I've got this rule which I've been using a while. Now all of a sudden it doesn't work anymore while I've nothing changed in it, i get this error message (attachment). Any idea what can be the problem? It is used for a lot of files, but i included a sample file.

 

aPath = ThisDoc.Path
iPropParNum = iProperties.Value("Project", "Part Number")
iPropRevNum = iProperties.Value("Project", "Revision Number")
aFolder = aPath & "\" & "DWG"
aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
aDataMedium.FileName = aFolder & "\" & iPropParNum & " rev" & iPropRevNum & " - 2D drawing" & ".dwg"
aName = aDataMedium.FileName
aDWG = ThisApplication.ApplicationAddIns.ItemById("{C24E3AC2-122E-11D5-8E91-0010B541CD80}") 
aDoc = ThisApplication.ActiveDocument  
transObjs = ThisApplication.TransientObjects 
aContext = transObjs.CreateTranslationContext 
aContext.Type = kFileBrowseIOMechanism 

aOptions = transObjs.CreateNameValueMap 
If aDWG.HasSaveCopyAsOptions(aDoc, aContext, aOptions) Then 
End If

If Not iPropParNum = "" Then
aDWG.SaveCopyAs(aDoc, aContext, aOptions, aDataMedium)
End If

If System.IO.File.Exists( aFolder & "\" & " rev" & " - 2D drawing" & ".dwg" ) = True Then
System.IO.File.Delete( aFolder & "\" & " rev" & " - 2D drawing" & ".dwg" )
End If

If System.IO.File.Exists( aFolder & "\" & iPropParNum & " rev" & " - 2D drawing" & ".dwg" ) = True Then
System.IO.File.Move( aFolder & "\" & iPropParNum & " rev" & " - 2D drawing" & ".dwg", aFolder & "\" & iPropParNum & " - 2D drawing" & ".dwg" )
End If

 

Thanks,

Stan

3 REPLIES 3
Message 2 of 4
stannm
in reply to: stannm

Well i found that on other computers the code works just fine... However, it won't work on my computer. I already read this http://www.solutioncottage.com/ShowSolution.aspx?solID=59 . But that didn't work or I am doing it wrong.
Message 3 of 4
stannm
in reply to: stannm

bump
Message 4 of 4
cwhetten
in reply to: stannm

Hi and welcome to the forum!

 

I don't have the same version of Inventor as you (I am using 2014), so I can't open your files.

 

You can try posting your question in the Inventor Customization forum.  You might get more help there.

 

Cameron Whetten
Inventor 2014

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

Post to forums