<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: iLogic problem in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5410505#M121897</link>
    <description>&lt;P&gt;Dshortway,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for taking the time, and you're a great teacher also haha. I do understand it now, first i wasn't sure how to handle the maps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;</description>
    <pubDate>Tue, 18 Nov 2014 10:22:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2014-11-18T10:22:08Z</dc:date>
    <item>
      <title>iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5382071#M121880</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to create an iLogic rule which opens every drawing of every part in a assembly and then launches my rule to create a PDF and then closes the document one by one. I thought i'd be as simple as this but apperently I'm wrong.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With this code it only opens the drawing of the assembly and then closes it and then does that again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oAsmDoc As AssemblyDocument
oAsmDoc = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator
oRefDocs = oAsmDoc.AllReferencedDocuments
Dim oRefDoc As Document
For Each oRefDoc In oRefDocs
iLogicVb.RunExternalRule("Overige - open drawing")
iLogicVb.RunExternalRule("Export - PDF in assembly")
ThisApplication.ActiveDocument.Close(True)
Next&lt;/PRE&gt;&lt;P&gt;Can anyone help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;</description>
      <pubDate>Wed, 05 Nov 2014 10:36:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5382071#M121880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-05T10:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385001#M121881</link>
      <description>&lt;P&gt;Stan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is as simple as this :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_self" href="http://inventortrenches.blogspot.co.uk/2012/11/ilogic-batch-output-pdfs-from-assembly.html"&gt;http://inventortrenches.blogspot.co.uk/2012/11/ilogic-batch-output-pdfs-from-assembly.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The maestro has it all. Clone his website all completely&amp;nbsp;like I did.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You Curtis!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 07:42:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385001#M121881</guid>
      <dc:creator>salariua</dc:creator>
      <dc:date>2014-11-06T07:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385057#M121882</link>
      <description>&lt;P&gt;I've tried that, except it doesn't work for me. My PDF export rule is more&amp;nbsp;worked-out than Curtis' rule and I can't combine it (tried it without success), one of the reasons why it won't work is because we have different filenames for .ipt, .idw and .iam files.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If somebody could strip his rule down to only the part where&amp;nbsp;i can fire a rule on each part, that would solve it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 08:28:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385057#M121882</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-06T08:28:07Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385187#M121883</link>
      <description>&lt;P&gt;is there some sort of&amp;nbsp;logic between the drawing filename, part filename and assembly filename?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 09:46:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385187#M121883</guid>
      <dc:creator>salariua</dc:creator>
      <dc:date>2014-11-06T09:46:07Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385251#M121884</link>
      <description>&lt;P&gt;Yes, the drawings have as filename the parts or assemblies part number. And i already have a rule which opens the drawing when i'm in the part or assembly. So i just need to fire this and the PDF rule in every part, then i've got it i think.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;aPath = ThisDoc.Path
ParNum = iProperties.Value("Project", "Part Number")
aName = aPath &amp;amp; "\" &amp;amp; ParNum &amp;amp; ".idw"

InventorVb.DocumentUpdate()
ThisDoc.Save

ThisDoc.Launch(aName)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 10:05:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5385251#M121884</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-06T10:05:25Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5387203#M121885</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;is it possible to have a look to your external rules?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe you are referencing "ThisDoc" in each rule, this will cause a wrong result.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Within the following post there is an explanation of this bad practice used with external rules.&lt;/P&gt;&lt;P&gt;&lt;A target="_blank" href="http://forums.autodesk.com/t5/inventor-general-discussion/ilogic-rules-work-when-run-separately-not-when-called-by-master/m-p/5226063#M519120"&gt;http://forums.autodesk.com/t5/inventor-general-discussion/ilogic-rules-work-when-run-separately-not-when-called-by-master/m-p/5226063#M519120&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Thu, 06 Nov 2014 22:09:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5387203#M121885</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-06T22:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5387869#M121886</link>
      <description>&lt;P&gt;Right! That's probably what I'm doing wrong. I've tried some things before i wrote this response but i can't get it to work. The external rules you asked for:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open drawing:&lt;/P&gt;&lt;PRE&gt;aPath = ThisDoc.Path
ParNum = iProperties.Value("Project", "Part Number")
aName = aPath &amp;amp; "\" &amp;amp; ParNum &amp;amp; ".idw"

ThisDoc.Launch(aName)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PDF:&lt;/P&gt;&lt;PRE&gt;Sub Main()
	oDoc = ThisDoc.Document
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName)
	
	If Not oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
	MessageBox.Show("This is not a drawing. Please open a drawing to create a PDF-file.", "iLogic", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
	Exit Sub
	Else If iProperties.Value(aModel, "Project", "Part Number") = "" Then
		question = MessageBox.Show("The part number is not filled out in the iProperties, do you want to enter a part number?", "iLogic", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
		If question = vbNo Then
		Exit Sub
		ElseIf question = vbYes Then
		iProperties.Value(aModel, "Project", "Part Number") = InputBox("Enter a part number.", "iLogic", "")
		End If
	Else
	InventorVb.DocumentUpdate()
	ThisDoc.Save
	Update
	Create
	Move
	Export
	Message
	End If
End Sub
Public Sub Update
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName)
	
	iProperties.Value("Summary", "Title") = iProperties.Value(aModel, "Summary", "Title")
	iProperties.Value("Summary", "Subject") = iProperties.Value(aModel, "Summary", "Subject")
	iProperties.Value("Project", "Part Number") = iProperties.Value(aModel, "Project", "Part Number")
	iProperties.Value("Project", "Revision Number") = iProperties.Value(aModel, "Project", "Revision Number")
End Sub
Public Sub Create
	aPath = ThisDoc.Path
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "Oud"
	
	If Not System.IO.Directory.Exists(aFolder) Then
	System.IO.Directory.CreateDirectory(aFolder)
	End If
	
	If Not System.IO.Directory.Exists(bFolder) Then
	System.IO.Directory.CreateDirectory(bFolder)
	End If
End Sub
Public Sub Move
	aPath = ThisDoc.Path
	iPropParNum = iProperties.Value("Project", "Part Number")
	
	noneFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	noneLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" 
	none2FileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev.pdf"
	none2Location = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev.pdf" 
	aFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revA.pdf"
	aLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revA.pdf"
	bFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revB.pdf"
	bLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revB.pdf"
	cFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revC.pdf"
	cLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revC.pdf"
	dFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revD.pdf"
	dLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revD.pdf"
	eFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revE.pdf"
	eLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revE.pdf"
	fFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revF.pdf"
	fLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revF.pdf"
	gFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revG.pdf"
	gLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revG.pdf"
	hFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revH.pdf"
	hLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revH.pdf"
	iFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revI.pdf"
	iLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revI.pdf"
	jFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revJ.pdf"
	jLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revJ.pdf"
	kFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revK.pdf"
	kLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revK.pdf"
	lFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revL.pdf"
	lLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revL.pdf"
	mFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revM.pdf"
	mLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revM.pdf"
	nFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revN.pdf"
	nLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revN.pdf"
	oFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revO.pdf"
	oLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revO.pdf"
	pFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revP.pdf"
	pLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revP.pdf"
	qFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revQ.pdf"
	qLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revQ.pdf"
	rFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revR.pdf"
	rLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revR.pdf"
	sFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revS.pdf"
	sLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revS.pdf"
	tFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revT.pdf"
	tLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revT.pdf"
	uFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revU.pdf"
	uLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revU.pdf"
	vFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revV.pdf"
	vLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revV.pdf"
	wFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revW.pdf"
	wLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revW.pdf"
	xFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revX.pdf"
	xLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revX.pdf"
	yFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revY.pdf"
	yLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revY.pdf"
	zFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revZ.pdf"
	zLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " revZ.pdf"
	auFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revA.pdf"
	auLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revA.pdf"
	buFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revB.pdf"
	buLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revB.pdf"
	cuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revC.pdf"
	cuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revC.pdf"
	duFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revD.pdf"
	duLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revD.pdf"
	euFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revE.pdf"
	euLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revE.pdf"
	fuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revF.pdf"
	fuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revF.pdf"
	guFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revG.pdf"
	guLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revG.pdf"
	huFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revH.pdf"
	huLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revH.pdf"
	iuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revI.pdf"
	iuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revI.pdf"
	juFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revJ.pdf"
	juLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revJ.pdf"
	kuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revK.pdf"
	kuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revK.pdf"
	luFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revL.pdf"
	luLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revL.pdf"
	muFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revM.pdf"
	muLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revM.pdf"
	nuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revN.pdf"
	nuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revN.pdf"
	ouFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revO.pdf"
	ouLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revO.pdf"
	puFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revP.pdf"
	puLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revP.pdf"
	quFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revQ.pdf"
	quLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revQ.pdf"
	ruFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revR.pdf"
	ruLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revR.pdf"
	suFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revS.pdf"
	suLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revS.pdf"
	tuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revT.pdf"
	tuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revT.pdf"
	uuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revU.pdf"
	uuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revU.pdf"
	vuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revV.pdf"
	vuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revV.pdf"
	wuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revW.pdf"
	wuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revW.pdf"
	xuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revX.pdf"
	xuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revX.pdf"
	yuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revY.pdf"
	yuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revY.pdf"
	zuFileToMove = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revZ.pdf"
	zuLocation = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; "_revZ.pdf"
	
	If System.IO.File.Exists( noneFileToMove ) = True Then
	System.IO.File.Delete( noneLocation )
	System.IO.File.Move( noneFileToMove, noneLocation )
	End If
	If System.IO.File.Exists( none2FileToMove ) = True Then
	System.IO.File.Delete( none2Location )
	System.IO.File.Move( none2FileToMove, none2Location )
	End If
	If System.IO.File.Exists( aFileToMove ) = True Then
	System.IO.File.Delete( aLocation )
	System.IO.File.Move( aFileToMove, aLocation )
	End If
	If System.IO.File.Exists( bFileToMove ) = True Then
	System.IO.File.Delete( bLocation )
	System.IO.File.Move( bFileToMove, bLocation )
	End If
	If System.IO.File.Exists( cFileToMove ) = True Then
	System.IO.File.Delete( cLocation )
	System.IO.File.Move( cFileToMove, cLocation )
	End If
	If System.IO.File.Exists( dFileToMove ) = True Then
	System.IO.File.Delete( dLocation )
	System.IO.File.Move( dFileToMove, dLocation )
	End If
	If System.IO.File.Exists( eFileToMove ) = True Then
	System.IO.File.Delete( eLocation )
	System.IO.File.Move( eFileToMove, eLocation )
	End If
	If System.IO.File.Exists( fFileToMove ) = True Then
	System.IO.File.Delete( fLocation )
	System.IO.File.Move( fFileToMove, fLocation )
	End If
	If System.IO.File.Exists( gFileToMove ) = True Then
	System.IO.File.Delete( gLocation )
	System.IO.File.Move( gFileToMove, gLocation )
	End If
	If System.IO.File.Exists( hFileToMove ) = True Then
	System.IO.File.Delete( hLocation )
	System.IO.File.Move( hFileToMove, hLocation )
	End If
	If System.IO.File.Exists( iFileToMove ) = True Then
	System.IO.File.Delete( iLocation )
	System.IO.File.Move( iFileToMove, iLocation )
	End If
	If System.IO.File.Exists( jFileToMove ) = True Then
	System.IO.File.Delete( jLocation )
	System.IO.File.Move( jFileToMove, jLocation )
	End If
	If System.IO.File.Exists( kFileToMove ) = True Then
	System.IO.File.Delete( kLocation )
	System.IO.File.Move( kFileToMove, kLocation )
	End If
	If System.IO.File.Exists( lFileToMove ) = True Then
	System.IO.File.Delete( lLocation )
	System.IO.File.Move( lFileToMove, lLocation )
	End If
	If System.IO.File.Exists( mFileToMove ) = True Then
	System.IO.File.Delete( mLocation )
	System.IO.File.Move( mFileToMove, mLocation )
	End If
	If System.IO.File.Exists( nFileToMove ) = True Then
	System.IO.File.Delete( nLocation )
	System.IO.File.Move( nFileToMove, nLocation )
	End If
	If System.IO.File.Exists( oFileToMove ) = True Then
	System.IO.File.Delete( oLocation )
	System.IO.File.Move( oFileToMove, oLocation )
	End If
	If System.IO.File.Exists( pFileToMove ) = True Then
	System.IO.File.Delete( pLocation )
	System.IO.File.Move( pFileToMove, pLocation )
	End If
	If System.IO.File.Exists( qFileToMove ) = True Then
	System.IO.File.Delete( qLocation )
	System.IO.File.Move( qFileToMove, qLocation )
	End If
	If System.IO.File.Exists( rFileToMove ) = True Then
	System.IO.File.Delete( rLocation )
	System.IO.File.Move( rFileToMove, rLocation )
	End If
	If System.IO.File.Exists( sFileToMove ) = True Then
	System.IO.File.Delete( sLocation )
	System.IO.File.Move( sFileToMove, sLocation )
	End If
	If System.IO.File.Exists( tFileToMove ) = True Then
	System.IO.File.Delete( tLocation )
	System.IO.File.Move( tFileToMove, tLocation )
	End If
	If System.IO.File.Exists( uFileToMove ) = True Then
	System.IO.File.Delete( uLocation )
	System.IO.File.Move( uFileToMove, uLocation )
	End If
	If System.IO.File.Exists( vFileToMove ) = True Then
	System.IO.File.Delete( vLocation )
	System.IO.File.Move( vFileToMove, vLocation )
	End If
	If System.IO.File.Exists( wFileToMove ) = True Then
	System.IO.File.Delete( wLocation )
	System.IO.File.Move( wFileToMove, wLocation )
	End If
	If System.IO.File.Exists( xFileToMove ) = True Then
	System.IO.File.Delete( xLocation )
	System.IO.File.Move( xFileToMove, xLocation )
	End If
	If System.IO.File.Exists( yFileToMove ) = True Then
	System.IO.File.Delete( yLocation )
	System.IO.File.Move( yFileToMove, yLocation )
	End If
	If System.IO.File.Exists( zFileToMove ) = True Then
	System.IO.File.Delete( zLocation )
	System.IO.File.Move( zFileToMove, zLocation )
	End If
	If System.IO.File.Exists( auFileToMove ) = True Then
	System.IO.File.Delete( auLocation )
	System.IO.File.Move( auFileToMove, auLocation )
	End If
	If System.IO.File.Exists( buFileToMove ) = True Then
	System.IO.File.Delete( buLocation )
	System.IO.File.Move( buFileToMove, buLocation )
	End If
	If System.IO.File.Exists( cuFileToMove ) = True Then
	System.IO.File.Delete( cuLocation )
	System.IO.File.Move( cuFileToMove, cuLocation )
	End If
	If System.IO.File.Exists( duFileToMove ) = True Then
	System.IO.File.Delete( duLocation )
	System.IO.File.Move( duFileToMove, duLocation )
	End If
	If System.IO.File.Exists( euFileToMove ) = True Then
	System.IO.File.Delete( euLocation )
	System.IO.File.Move( euFileToMove, euLocation )
	End If
	If System.IO.File.Exists( fuFileToMove ) = True Then
	System.IO.File.Delete( fuLocation )
	System.IO.File.Move( fuFileToMove, fuLocation )
	End If
	If System.IO.File.Exists( guFileToMove ) = True Then
	System.IO.File.Delete( guLocation )
	System.IO.File.Move( guFileToMove, guLocation )
	End If
	If System.IO.File.Exists( huFileToMove ) = True Then
	System.IO.File.Delete( huLocation )
	System.IO.File.Move( huFileToMove, huLocation )
	End If
	If System.IO.File.Exists( iuFileToMove ) = True Then
	System.IO.File.Delete( iuLocation )
	System.IO.File.Move( iuFileToMove, iuLocation )
	End If
	If System.IO.File.Exists( juFileToMove ) = True Then
	System.IO.File.Delete( juLocation )
	System.IO.File.Move( juFileToMove, juLocation )
	End If
	If System.IO.File.Exists( kuFileToMove ) = True Then
	System.IO.File.Delete( kuLocation )
	System.IO.File.Move( kuFileToMove, kuLocation )
	End If
	If System.IO.File.Exists( luFileToMove ) = True Then
	System.IO.File.Delete( luLocation )
	System.IO.File.Move( luFileToMove, luLocation )
	End If
	If System.IO.File.Exists( muFileToMove ) = True Then
	System.IO.File.Delete( muLocation )
	System.IO.File.Move( muFileToMove, muLocation )
	End If
	If System.IO.File.Exists( nuFileToMove ) = True Then
	System.IO.File.Delete( nuLocation )
	System.IO.File.Move( nuFileToMove, nuLocation )
	End If
	If System.IO.File.Exists( ouFileToMove ) = True Then
	System.IO.File.Delete( ouLocation )
	System.IO.File.Move( ouFileToMove, ouLocation )
	End If
	If System.IO.File.Exists( puFileToMove ) = True Then
	System.IO.File.Delete( puLocation )
	System.IO.File.Move( puFileToMove, puLocation )
	End If
	If System.IO.File.Exists( quFileToMove ) = True Then
	System.IO.File.Delete( quLocation )
	System.IO.File.Move( quFileToMove, quLocation )
	End If
	If System.IO.File.Exists( ruFileToMove ) = True Then
	System.IO.File.Delete( ruLocation )
	System.IO.File.Move( ruFileToMove, ruLocation )
	End If
	If System.IO.File.Exists( suFileToMove ) = True Then
	System.IO.File.Delete( suLocation )
	System.IO.File.Move( suFileToMove, suLocation )
	End If
	If System.IO.File.Exists( tuFileToMove ) = True Then
	System.IO.File.Delete( tuLocation )
	System.IO.File.Move( tuFileToMove, tuLocation )
	End If
	If System.IO.File.Exists( uuFileToMove ) = True Then
	System.IO.File.Delete( uuLocation )
	System.IO.File.Move( uuFileToMove, uuLocation )
	End If
	If System.IO.File.Exists( vuFileToMove ) = True Then
	System.IO.File.Delete( vuLocation )
	System.IO.File.Move( vuFileToMove, vuLocation )
	End If
	If System.IO.File.Exists( wuFileToMove ) = True Then
	System.IO.File.Delete( wuLocation )
	System.IO.File.Move( wuFileToMove, wuLocation )
	End If
	If System.IO.File.Exists( xuFileToMove ) = True Then
	System.IO.File.Delete( xuLocation )
	System.IO.File.Move( xuFileToMove, xuLocation )
	End If
	If System.IO.File.Exists( yuFileToMove ) = True Then
	System.IO.File.Delete( yuLocation )
	System.IO.File.Move( yuFileToMove, yuLocation )
	End If
	If System.IO.File.Exists( zuFileToMove ) = True Then
	System.IO.File.Delete( zuLocation )
	System.IO.File.Move( zuFileToMove, zuLocation )
	End If
End Sub
Public Sub Export()
	aPath = ThisDoc.Path
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aPDF = ThisApplication.ApplicationAddIns.ItemById _
	("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	aDocument = ThisApplication.ActiveDocument
	aContext = ThisApplication.TransientObjects.CreateTranslationContext
	aContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	aPDFOptions = ThisApplication.TransientObjects.CreateNameValueMap
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "oud"
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName
	
	If aPDF.HasSaveCopyAsOptions(aDataMedium, aContext, aPDFOptions) Then
	aPDFOptions.Value("All_Color_AS_Black") = 1
	aPDFOptions.Value("Remove_Line_Weights") = 1
	aPDFOptions.Value("Vector_Resolution") = 4800
	aPDFOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
	End If
	
	aPDF.SaveCopyAs(aDocument, aContext, aPDFOptions, aDataMedium)
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf" ) = True Then
	System.IO.File.Delete( aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" ) = True Then
	System.IO.File.Delete( aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf" ) = True Then
	System.IO.File.Delete( aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf" ) = True Then
	System.IO.File.Move( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf" ) = True Then
	System.IO.File.Move( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" ) = True Then
	System.IO.File.Delete( bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	End If
	
	If System.IO.File.Exists( aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" ) = True Then
	System.IO.File.Delete( bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" )
	End If
End Sub
Public Sub Message()
	aPath = ThisDoc.Path
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName
	
	If iPropRevNum = "" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	Else If iPropRevNum = "-" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	End If
	
	If Not aName = aFolder &amp;amp; "\" &amp;amp; ".pdf" Then
	question = MessageBox.Show("Het bestand is opgeslagen in " &amp;amp; aName _
	&amp;amp; vbNewLine _
	&amp;amp; vbNewLine &amp;amp; "Bestand openen?" , "Opgeslagen",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
	If question = vbYes Then 
	ThisDoc.Launch(aName)
	End If
	End If
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you could show me how I get the "open drawing" code to work I think I can figure out the rest.&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 07 Nov 2014 07:11:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5387869#M121886</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-07T07:11:30Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5390539#M121887</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;I think this is the correct code for your solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main Rule:&lt;/P&gt;&lt;PRE&gt;Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments

' the following two lines are necessary to pass arguments to the external rule
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("aPath", ThisDoc.Path)
'map.Add("aFullFileName", "")

Dim oRefDoc As Document
For Each oRefDoc In oRefDocs
	'map.Value("aFullFileName") = oRefDoc.FullFileName ' I've used this line for my tests, but is a useful information for your code
	'ThisDoc.Launch(oRefDoc.FullFileName) ' If you want open the referenced filename, I've used this line for my tests
	iLogicVb.RunExternalRule("Overige - open drawing", map) ' your external rule receive the aPath argument
	iLogicVb.RunExternalRule("Export - PDF in assembly", map) ' your external rule receive the aPath argument
	oRefDoc.Close(True) ' this close the referenced document
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;External Rule to Open the referenced document (I think is a better solution if you integrate this code in the main rule):&lt;/P&gt;&lt;PRE&gt;'aPath = ThisDoc.Path
ParNum = iProperties.Value("Project", "Part Number")
aName = RuleArguments("aPath") &amp;amp; "\" &amp;amp; ParNum &amp;amp; ".idw" ' this line read the given argument

ThisDoc.Launch(aName)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;External Rule to export PDF:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;(Please read and check carefully this rule&amp;nbsp;before you run it)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Sub Main()
	' this information can be easily passed as an argument
	' in some cases this code give you wrong information, for example when you call it from an assembly
	' this is the right code:
	' Dim oDoc As inventor._Document=ThisApplication.documents.itembyname(RuleArguments("aFullFileName"))
	oDoc = ThisDoc.Document
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) ' RuleArguments("aFullFileName")
	
	If Not oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
		MessageBox.Show("This is not a drawing. Please open a drawing to create a PDF-file.", "iLogic", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
		Exit Sub
	Else If iProperties.Value(aModel, "Project", "Part Number") = "" Then
		question = MessageBox.Show("The part number is not filled out in the iProperties, do you want to enter a part number?", "iLogic", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
		If question = vbNo Then
			Exit Sub
		ElseIf question = vbYes Then
			iProperties.Value(aModel, "Project", "Part Number") = InputBox("Enter a part number.", "iLogic", "")
		End If
	Else
		InventorVb.DocumentUpdate()
		ThisDoc.Save	' oDoc.Save
		Update
		Create
		Move
		Export
		Message
	End If
End Sub
Public Sub Update
	' this information can be easily passed as an argument
	 ' in some cases this code give you wrong information, for example when you call it from an assembly
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) ' RuleArguments("aFullFileName")
	
	iProperties.Value("Summary", "Title") = iProperties.Value(aModel, "Summary", "Title")
	iProperties.Value("Summary", "Subject") = iProperties.Value(aModel, "Summary", "Subject")
	iProperties.Value("Project", "Part Number") = iProperties.Value(aModel, "Project", "Part Number")
	iProperties.Value("Project", "Revision Number") = iProperties.Value(aModel, "Project", "Revision Number")
End Sub
Public Sub Create
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' **** my correction
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "Oud"
	
	If Not System.IO.Directory.Exists(aFolder) Then
	System.IO.Directory.CreateDirectory(aFolder)
	End If
	
	If Not System.IO.Directory.Exists(bFolder) Then
	System.IO.Directory.CreateDirectory(bFolder)
	End If
End Sub
Public Sub Move
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' **** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	' *** my suggestion
	pDXF = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\"&amp;amp; iPropParNum
	pOUD = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\"&amp;amp; iPropParNum
	noneFileToMove = &lt;STRONG&gt;pDXF &amp;amp; ".pdf"&lt;/STRONG&gt; ' you don't need to assign this text to a variable
	noneLocation = &lt;STRONG&gt;pOUD &amp;amp; ".pdf"&lt;/STRONG&gt;   ' used it as subroutine argument
	none2FileToMove = pDXF &amp;amp; " rev.pdf"
	none2Location = pOUD &amp;amp; " rev.pdf" 
	aFileToMove = pDXF &amp;amp; " revA.pdf"
	aLocation = pOUD &amp;amp; " revA.pdf"
	bFileToMove = pDXF &amp;amp; " revB.pdf"
	bLocation = pOUD &amp;amp; " revB.pdf"
	cFileToMove = pDXF &amp;amp; " revC.pdf"
	cLocation = pOUD &amp;amp; " revC.pdf"
	dFileToMove = pDXF &amp;amp; " revD.pdf"
	dLocation = pOUD &amp;amp; " revD.pdf"
	eFileToMove = pDXF &amp;amp; " revE.pdf"
	eLocation = pOUD &amp;amp; " revE.pdf"
	fFileToMove = pDXF &amp;amp; " revF.pdf"
	fLocation = pOUD &amp;amp; " revF.pdf"
	gFileToMove = pDXF &amp;amp; " revG.pdf"
	gLocation = pOUD &amp;amp; " revG.pdf"
	hFileToMove = pDXF &amp;amp; " revH.pdf"
	hLocation = pOUD &amp;amp; " revH.pdf"
	iFileToMove = pDXF &amp;amp; " revI.pdf"
	iLocation = pOUD &amp;amp; " revI.pdf"
	jFileToMove = pDXF &amp;amp; " revJ.pdf"
	jLocation = pOUD &amp;amp; " revJ.pdf"
	kFileToMove = pDXF &amp;amp; " revK.pdf"
	kLocation = pOUD &amp;amp; " revK.pdf"
	lFileToMove = pDXF &amp;amp; " revL.pdf"
	lLocation = pOUD &amp;amp; " revL.pdf"
	mFileToMove = pDXF &amp;amp; " revM.pdf"
	mLocation = pOUD &amp;amp; " revM.pdf"
	nFileToMove = pDXF &amp;amp; " revN.pdf"
	nLocation = pOUD &amp;amp; " revN.pdf"
	oFileToMove = pDXF &amp;amp; " revO.pdf"
	oLocation = pOUD &amp;amp; " revO.pdf"
	pFileToMove = pDXF &amp;amp; " revP.pdf"
	pLocation = pOUD &amp;amp; " revP.pdf"
	qFileToMove = pDXF &amp;amp; " revQ.pdf"
	qLocation = pOUD &amp;amp; " revQ.pdf"
	rFileToMove = pDXF &amp;amp; " revR.pdf"
	rLocation = pOUD &amp;amp; " revR.pdf"
	sFileToMove = pDXF &amp;amp; " revS.pdf"
	sLocation = pOUD &amp;amp; " revS.pdf"
	tFileToMove = pDXF &amp;amp; " revT.pdf"
	tLocation = pOUD &amp;amp; " revT.pdf"
	uFileToMove = pDXF &amp;amp; " revU.pdf"
	uLocation = pOUD &amp;amp; " revU.pdf"
	vFileToMove = pDXF &amp;amp; " revV.pdf"
	vLocation = pOUD &amp;amp; " revV.pdf"
	wFileToMove = pDXF &amp;amp; " revW.pdf"
	wLocation = pOUD &amp;amp; " revW.pdf"
	xFileToMove = pDXF &amp;amp; " revX.pdf"
	xLocation = pOUD &amp;amp; " revX.pdf"
	yFileToMove = pDXF &amp;amp; " revY.pdf"
	yLocation = pOUD &amp;amp; " revY.pdf"
	zFileToMove = pDXF &amp;amp; " revZ.pdf"
	zLocation = pOUD &amp;amp; " revZ.pdf"
	auFileToMove = pDXF &amp;amp; "_revA.pdf"
	auLocation = pOUD &amp;amp; "_revA.pdf"
	buFileToMove = pDXF &amp;amp; "_revB.pdf"
	buLocation = pOUD &amp;amp; "_revB.pdf"
	cuFileToMove = pDXF &amp;amp; "_revC.pdf"
	cuLocation = pOUD &amp;amp; "_revC.pdf"
	duFileToMove = pDXF &amp;amp; "_revD.pdf"
	duLocation = pOUD &amp;amp; "_revD.pdf"
	euFileToMove = pDXF &amp;amp; "_revE.pdf"
	euLocation = pOUD &amp;amp; "_revE.pdf"
	fuFileToMove = pDXF &amp;amp; "_revF.pdf"
	fuLocation = pOUD &amp;amp; "_revF.pdf"
	guFileToMove = pDXF &amp;amp; "_revG.pdf"
	guLocation = pOUD &amp;amp; "_revG.pdf"
	huFileToMove = pDXF &amp;amp; "_revH.pdf"
	huLocation = pOUD &amp;amp; "_revH.pdf"
	iuFileToMove = pDXF &amp;amp; "_revI.pdf"
	iuLocation = pOUD &amp;amp; "_revI.pdf"
	juFileToMove = pDXF &amp;amp; "_revJ.pdf"
	juLocation = pOUD &amp;amp; "_revJ.pdf"
	kuFileToMove = pDXF &amp;amp; "_revK.pdf"
	kuLocation = pOUD &amp;amp; "_revK.pdf"
	luFileToMove = pDXF &amp;amp; "_revL.pdf"
	luLocation = pOUD &amp;amp; "_revL.pdf"
	muFileToMove = pDXF &amp;amp; "_revM.pdf"
	muLocation = pOUD &amp;amp; "_revM.pdf"
	nuFileToMove = pDXF &amp;amp; "_revN.pdf"
	nuLocation = pOUD &amp;amp; "_revN.pdf"
	ouFileToMove = pDXF &amp;amp; "_revO.pdf"
	ouLocation = pOUD &amp;amp; "_revO.pdf"
	puFileToMove = pDXF &amp;amp; "_revP.pdf"
	puLocation = pOUD &amp;amp; "_revP.pdf"
	quFileToMove = pDXF &amp;amp; "_revQ.pdf"
	quLocation = pOUD &amp;amp; "_revQ.pdf"
	ruFileToMove = pDXF &amp;amp; "_revR.pdf"
	ruLocation = pOUD &amp;amp; "_revR.pdf"
	suFileToMove = pDXF &amp;amp; "_revS.pdf"
	suLocation = pOUD &amp;amp; "_revS.pdf"
	tuFileToMove = pDXF &amp;amp; "_revT.pdf"
	tuLocation = pOUD &amp;amp; "_revT.pdf"
	uuFileToMove = pDXF &amp;amp; "_revU.pdf"
	uuLocation = pOUD &amp;amp; "_revU.pdf"
	vuFileToMove = pDXF &amp;amp; "_revV.pdf"
	vuLocation = pOUD &amp;amp; "_revV.pdf"
	wuFileToMove = pDXF &amp;amp; "_revW.pdf"
	wuLocation = pOUD &amp;amp; "_revW.pdf"
	xuFileToMove = pDXF &amp;amp; "_revX.pdf"
	xuLocation = pOUD &amp;amp; "_revX.pdf"
	yuFileToMove = pDXF &amp;amp; "_revY.pdf"
	yuLocation = pOUD &amp;amp; "_revY.pdf"
	zuFileToMove = pDXF &amp;amp; "_revZ.pdf"
	zuLocation = pOUD &amp;amp; "_revZ.pdf"
	&lt;BR /&gt;        ' you don' need to assign a variable for each line&lt;BR /&gt;        ' Check_Del_Move_File( pDXF &amp;amp; ".pdf", pOUD &amp;amp; ".pdf")&lt;BR /&gt;	Check_Del_Move_File( noneFileToMove, noneLocation )
	Check_Del_Move_File( none2FileToMove, none2Location )
	Check_Del_Move_File( aFileToMove, aLocation )
	Check_Del_Move_File( bFileToMove, bLocation )
	Check_Del_Move_File( cFileToMove, cLocation )
	Check_Del_Move_File( dFileToMove, dLocation )
	Check_Del_Move_File( eFileToMove, eLocation )
	Check_Del_Move_File( fFileToMove, fLocation )
	Check_Del_Move_File( gFileToMove, gLocation )
	Check_Del_Move_File( hFileToMove, hLocation )
	Check_Del_Move_File( iFileToMove, iLocation )
	Check_Del_Move_File( jFileToMove, jLocation )
	Check_Del_Move_File( kFileToMove, kLocation )
	Check_Del_Move_File( lFileToMove, lLocation )
	Check_Del_Move_File( mFileToMove, mLocation )
	Check_Del_Move_File( nFileToMove, nLocation )
	Check_Del_Move_File( oFileToMove, oLocation )
	Check_Del_Move_File( pFileToMove, pLocation )
	Check_Del_Move_File( qFileToMove, qLocation )
	Check_Del_Move_File( rFileToMove, rLocation )
	Check_Del_Move_File( sFileToMove, sLocation )
	Check_Del_Move_File( tFileToMove, tLocation )
	Check_Del_Move_File( uFileToMove, uLocation )
	Check_Del_Move_File( vFileToMove, vLocation )
	Check_Del_Move_File( wFileToMove, wLocation )
	Check_Del_Move_File( xFileToMove, xLocation )
	Check_Del_Move_File( yFileToMove, yLocation )
	Check_Del_Move_File( zFileToMove, zLocation )
	Check_Del_Move_File( auFileToMove, auLocation )
	Check_Del_Move_File( buFileToMove, buLocation )
	Check_Del_Move_File( cuFileToMove, cuLocation )
	Check_Del_Move_File( duFileToMove, duLocation )
	Check_Del_Move_File( euFileToMove, euLocation )
	Check_Del_Move_File( fuFileToMove, fuLocation )
	Check_Del_Move_File( guFileToMove, guLocation )
	Check_Del_Move_File( huFileToMove, huLocation )
	Check_Del_Move_File( iuFileToMove, iuLocation )
	Check_Del_Move_File( juFileToMove, juLocation )
	Check_Del_Move_File( kuFileToMove, kuLocation )
	Check_Del_Move_File( luFileToMove, luLocation )
	Check_Del_Move_File( muFileToMove, muLocation )
	Check_Del_Move_File( nuFileToMove, nuLocation )
	Check_Del_Move_File( ouFileToMove, ouLocation )
	Check_Del_Move_File( puFileToMove, puLocation )
	Check_Del_Move_File( quFileToMove, quLocation )
	Check_Del_Move_File( ruFileToMove, ruLocation )
	Check_Del_Move_File( suFileToMove, suLocation )
	Check_Del_Move_File( tuFileToMove, tuLocation )
	Check_Del_Move_File( uuFileToMove, uuLocation )
	Check_Del_Move_File( vuFileToMove, vuLocation )
	Check_Del_Move_File( wuFileToMove, wuLocation )
	Check_Del_Move_File( xuFileToMove, xuLocation )
	Check_Del_Move_File( yuFileToMove, yuLocation )
	Check_Del_Move_File( zuFileToMove, zuLocation )
	' *** end of suggestion
End Sub
Public Sub Export()
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' *** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aPDF = ThisApplication.ApplicationAddIns.ItemById _
	("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	aDocument = ThisApplication.ActiveDocument
	aContext = ThisApplication.TransientObjects.CreateTranslationContext
	aContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	aPDFOptions = ThisApplication.TransientObjects.CreateNameValueMap
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "oud"
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName ' *** this variable is not used ***
	
	If aPDF.HasSaveCopyAsOptions(aDataMedium, aContext, aPDFOptions) Then
		aPDFOptions.Value("All_Color_AS_Black") = 1
		aPDFOptions.Value("Remove_Line_Weights") = 1
		aPDFOptions.Value("Vector_Resolution") = 4800
		aPDFOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
	End If
	
	aPDF.SaveCopyAs(aDocument, aContext, aPDFOptions, aDataMedium)
	' *** the follow code has been adapted on my suggested subroutines
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf")
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf")
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf")
	Check_Move_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf", _
					aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf")
	Check_Move_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf", _
				aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf", bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf", _
				bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" )
End Sub

Sub Check_Del_File(oExist As String, oDelete As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oExist) = True Then
		System.IO.File.Delete(oDelete)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Sub Check_Move_File(oFileToMove As String, oLocation As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oFileToMove) = True Then
		System.IO.File.Move(oFileToMove, oLocation)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Sub Check_Del_Move_File(oFileToMove As String, oLocation As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oFileToMove) = True Then
		System.IO.File.Delete(oLocation)
		System.IO.File.Move(oFileToMove, oLocation)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Public Sub Message()
	'aPath = ThisDoc.Path
	'aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	aFolder = RuleArguments("aPath") &amp;amp; "\" &amp;amp; "DXF" ' *** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName ' I don't think you need this line
	
	' *** this condition don't do nothing, may be contain an error***
	If iPropRevNum = "" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	Else If iPropRevNum = "-" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	End If
	' ***
	
	If Not aName = aFolder &amp;amp; "\" &amp;amp; ".pdf" Then
		question = MessageBox.Show("Het bestand is opgeslagen in " &amp;amp; aName _
		&amp;amp; vbNewLine _
		&amp;amp; vbNewLine &amp;amp; "Bestand openen?" , "Opgeslagen",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
		If question = vbYes Then 
			ThisDoc.Launch(aName)
		End If
	End If
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if my corrections and my suggestions are helpful for you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 14:08:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5390539#M121887</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-08T14:08:07Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5390563#M121888</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;this my solution to your problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Main&amp;nbsp;Rule:&lt;/P&gt;&lt;PRE&gt;Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments

' the following two lines are necessary to pass arguments to the external rule
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("aPath", ThisDoc.Path)
'map.Add("aFullFileName", "")

Dim oRefDoc As Document
For Each oRefDoc In oRefDocs
	'map.Value("aFullFileName") = oRefDoc.FullFileName ' I've used this line for my tests, but is a useful information for your code
	'ThisDoc.Launch(oRefDoc.FullFileName) ' If you want open the referenced filename, I've used this line for my tests
	iLogicVb.RunExternalRule("Overige - open drawing", map) ' your external rule receive the aPath argument
	iLogicVb.RunExternalRule("Export - PDF in assembly", map) ' your external rule receive the aPath argument
	oRefDoc.Close(True) ' this close the referenced document
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Open Document Rule:&lt;/P&gt;&lt;PRE&gt;'aPath = ThisDoc.Path
ParNum = iProperties.Value("Project", "Part Number")
aName = RuleArguments("aPath") &amp;amp; "\" &amp;amp; ParNum &amp;amp; ".idw" ' this line read the given argument

ThisDoc.Launch(aName)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PDF export Rule: &lt;SPAN style="color: #ff0000;"&gt;(check carefully this rule before use it)&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;Sub Main()
	' this information can be easily passed as an argument
	' in some cases this code give you wrong information, for example when you call it from an assembly
	' this is the right code:
	' Dim oDoc As inventor._Document=ThisApplication.documents.itembyname(RuleArguments("aFullFileName"))
	oDoc = ThisDoc.Document
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) ' RuleArguments("aFullFileName")
	
	If Not oDoc.DocumentType = Inventor.DocumentTypeEnum.kDrawingDocumentObject Then
		MessageBox.Show("This is not a drawing. Please open a drawing to create a PDF-file.", "iLogic", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1)
		Exit Sub
	Else If iProperties.Value(aModel, "Project", "Part Number") = "" Then
		question = MessageBox.Show("The part number is not filled out in the iProperties, do you want to enter a part number?", "iLogic", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)
		If question = vbNo Then
			Exit Sub
		ElseIf question = vbYes Then
			iProperties.Value(aModel, "Project", "Part Number") = InputBox("Enter a part number.", "iLogic", "")
		End If
	Else
		InventorVb.DocumentUpdate()
		ThisDoc.Save	' oDoc.Save
		Update
		Create
		Move
		Export
		Message
	End If
End Sub
Public Sub Update
	' this information can be easily passed as an argument
	 ' in some cases this code give you wrong information, for example when you call it from an assembly
	aModel = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) ' RuleArguments("aFullFileName")
	
	iProperties.Value("Summary", "Title") = iProperties.Value(aModel, "Summary", "Title")
	iProperties.Value("Summary", "Subject") = iProperties.Value(aModel, "Summary", "Subject")
	iProperties.Value("Project", "Part Number") = iProperties.Value(aModel, "Project", "Part Number")
	iProperties.Value("Project", "Revision Number") = iProperties.Value(aModel, "Project", "Revision Number")
End Sub
Public Sub Create
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' **** my correction
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "Oud"
	
	If Not System.IO.Directory.Exists(aFolder) Then
	System.IO.Directory.CreateDirectory(aFolder)
	End If
	
	If Not System.IO.Directory.Exists(bFolder) Then
	System.IO.Directory.CreateDirectory(bFolder)
	End If
End Sub
Public Sub Move
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' **** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	' *** my suggestion
	pDXF = aPath &amp;amp; "\" &amp;amp; "DXF" &amp;amp; "\"&amp;amp; iPropParNum	' you don't need to assign a variable for each revision
	pOUD = aPath &amp;amp; "\" &amp;amp; "Oud" &amp;amp; "\"&amp;amp; iPropParNum	' use this text as subroutine argument
	noneFileToMove = pDXF &amp;amp; ".pdf"					' this will give you a shorter code
	noneLocation = pOUD &amp;amp; ".pdf" 
	none2FileToMove = pDXF &amp;amp; " rev.pdf"
	none2Location = pOUD &amp;amp; " rev.pdf" 
	aFileToMove = pDXF &amp;amp; " revA.pdf"
	aLocation = pOUD &amp;amp; " revA.pdf"
	bFileToMove = pDXF &amp;amp; " revB.pdf"
	bLocation = pOUD &amp;amp; " revB.pdf"
	cFileToMove = pDXF &amp;amp; " revC.pdf"
	cLocation = pOUD &amp;amp; " revC.pdf"
	dFileToMove = pDXF &amp;amp; " revD.pdf"
	dLocation = pOUD &amp;amp; " revD.pdf"
	eFileToMove = pDXF &amp;amp; " revE.pdf"
	eLocation = pOUD &amp;amp; " revE.pdf"
	fFileToMove = pDXF &amp;amp; " revF.pdf"
	fLocation = pOUD &amp;amp; " revF.pdf"
	gFileToMove = pDXF &amp;amp; " revG.pdf"
	gLocation = pOUD &amp;amp; " revG.pdf"
	hFileToMove = pDXF &amp;amp; " revH.pdf"
	hLocation = pOUD &amp;amp; " revH.pdf"
	iFileToMove = pDXF &amp;amp; " revI.pdf"
	iLocation = pOUD &amp;amp; " revI.pdf"
	jFileToMove = pDXF &amp;amp; " revJ.pdf"
	jLocation = pOUD &amp;amp; " revJ.pdf"
	kFileToMove = pDXF &amp;amp; " revK.pdf"
	kLocation = pOUD &amp;amp; " revK.pdf"
	lFileToMove = pDXF &amp;amp; " revL.pdf"
	lLocation = pOUD &amp;amp; " revL.pdf"
	mFileToMove = pDXF &amp;amp; " revM.pdf"
	mLocation = pOUD &amp;amp; " revM.pdf"
	nFileToMove = pDXF &amp;amp; " revN.pdf"
	nLocation = pOUD &amp;amp; " revN.pdf"
	oFileToMove = pDXF &amp;amp; " revO.pdf"
	oLocation = pOUD &amp;amp; " revO.pdf"
	pFileToMove = pDXF &amp;amp; " revP.pdf"
	pLocation = pOUD &amp;amp; " revP.pdf"
	qFileToMove = pDXF &amp;amp; " revQ.pdf"
	qLocation = pOUD &amp;amp; " revQ.pdf"
	rFileToMove = pDXF &amp;amp; " revR.pdf"
	rLocation = pOUD &amp;amp; " revR.pdf"
	sFileToMove = pDXF &amp;amp; " revS.pdf"
	sLocation = pOUD &amp;amp; " revS.pdf"
	tFileToMove = pDXF &amp;amp; " revT.pdf"
	tLocation = pOUD &amp;amp; " revT.pdf"
	uFileToMove = pDXF &amp;amp; " revU.pdf"
	uLocation = pOUD &amp;amp; " revU.pdf"
	vFileToMove = pDXF &amp;amp; " revV.pdf"
	vLocation = pOUD &amp;amp; " revV.pdf"
	wFileToMove = pDXF &amp;amp; " revW.pdf"
	wLocation = pOUD &amp;amp; " revW.pdf"
	xFileToMove = pDXF &amp;amp; " revX.pdf"
	xLocation = pOUD &amp;amp; " revX.pdf"
	yFileToMove = pDXF &amp;amp; " revY.pdf"
	yLocation = pOUD &amp;amp; " revY.pdf"
	zFileToMove = pDXF &amp;amp; " revZ.pdf"
	zLocation = pOUD &amp;amp; " revZ.pdf"
	auFileToMove = pDXF &amp;amp; "_revA.pdf"
	auLocation = pOUD &amp;amp; "_revA.pdf"
	buFileToMove = pDXF &amp;amp; "_revB.pdf"
	buLocation = pOUD &amp;amp; "_revB.pdf"
	cuFileToMove = pDXF &amp;amp; "_revC.pdf"
	cuLocation = pOUD &amp;amp; "_revC.pdf"
	duFileToMove = pDXF &amp;amp; "_revD.pdf"
	duLocation = pOUD &amp;amp; "_revD.pdf"
	euFileToMove = pDXF &amp;amp; "_revE.pdf"
	euLocation = pOUD &amp;amp; "_revE.pdf"
	fuFileToMove = pDXF &amp;amp; "_revF.pdf"
	fuLocation = pOUD &amp;amp; "_revF.pdf"
	guFileToMove = pDXF &amp;amp; "_revG.pdf"
	guLocation = pOUD &amp;amp; "_revG.pdf"
	huFileToMove = pDXF &amp;amp; "_revH.pdf"
	huLocation = pOUD &amp;amp; "_revH.pdf"
	iuFileToMove = pDXF &amp;amp; "_revI.pdf"
	iuLocation = pOUD &amp;amp; "_revI.pdf"
	juFileToMove = pDXF &amp;amp; "_revJ.pdf"
	juLocation = pOUD &amp;amp; "_revJ.pdf"
	kuFileToMove = pDXF &amp;amp; "_revK.pdf"
	kuLocation = pOUD &amp;amp; "_revK.pdf"
	luFileToMove = pDXF &amp;amp; "_revL.pdf"
	luLocation = pOUD &amp;amp; "_revL.pdf"
	muFileToMove = pDXF &amp;amp; "_revM.pdf"
	muLocation = pOUD &amp;amp; "_revM.pdf"
	nuFileToMove = pDXF &amp;amp; "_revN.pdf"
	nuLocation = pOUD &amp;amp; "_revN.pdf"
	ouFileToMove = pDXF &amp;amp; "_revO.pdf"
	ouLocation = pOUD &amp;amp; "_revO.pdf"
	puFileToMove = pDXF &amp;amp; "_revP.pdf"
	puLocation = pOUD &amp;amp; "_revP.pdf"
	quFileToMove = pDXF &amp;amp; "_revQ.pdf"
	quLocation = pOUD &amp;amp; "_revQ.pdf"
	ruFileToMove = pDXF &amp;amp; "_revR.pdf"
	ruLocation = pOUD &amp;amp; "_revR.pdf"
	suFileToMove = pDXF &amp;amp; "_revS.pdf"
	suLocation = pOUD &amp;amp; "_revS.pdf"
	tuFileToMove = pDXF &amp;amp; "_revT.pdf"
	tuLocation = pOUD &amp;amp; "_revT.pdf"
	uuFileToMove = pDXF &amp;amp; "_revU.pdf"
	uuLocation = pOUD &amp;amp; "_revU.pdf"
	vuFileToMove = pDXF &amp;amp; "_revV.pdf"
	vuLocation = pOUD &amp;amp; "_revV.pdf"
	wuFileToMove = pDXF &amp;amp; "_revW.pdf"
	wuLocation = pOUD &amp;amp; "_revW.pdf"
	xuFileToMove = pDXF &amp;amp; "_revX.pdf"
	xuLocation = pOUD &amp;amp; "_revX.pdf"
	yuFileToMove = pDXF &amp;amp; "_revY.pdf"
	yuLocation = pOUD &amp;amp; "_revY.pdf"
	zuFileToMove = pDXF &amp;amp; "_revZ.pdf"
	zuLocation = pOUD &amp;amp; "_revZ.pdf"
	
	' Check_Del_Move_File( pDXF &amp;amp; ".pdf", pOUD &amp;amp; ".pdf" ) ' use this instead of assign variables
	Check_Del_Move_File( noneFileToMove, noneLocation )
	Check_Del_Move_File( none2FileToMove, none2Location )
	Check_Del_Move_File( aFileToMove, aLocation )
	Check_Del_Move_File( bFileToMove, bLocation )
	Check_Del_Move_File( cFileToMove, cLocation )
	Check_Del_Move_File( dFileToMove, dLocation )
	Check_Del_Move_File( eFileToMove, eLocation )
	Check_Del_Move_File( fFileToMove, fLocation )
	Check_Del_Move_File( gFileToMove, gLocation )
	Check_Del_Move_File( hFileToMove, hLocation )
	Check_Del_Move_File( iFileToMove, iLocation )
	Check_Del_Move_File( jFileToMove, jLocation )
	Check_Del_Move_File( kFileToMove, kLocation )
	Check_Del_Move_File( lFileToMove, lLocation )
	Check_Del_Move_File( mFileToMove, mLocation )
	Check_Del_Move_File( nFileToMove, nLocation )
	Check_Del_Move_File( oFileToMove, oLocation )
	Check_Del_Move_File( pFileToMove, pLocation )
	Check_Del_Move_File( qFileToMove, qLocation )
	Check_Del_Move_File( rFileToMove, rLocation )
	Check_Del_Move_File( sFileToMove, sLocation )
	Check_Del_Move_File( tFileToMove, tLocation )
	Check_Del_Move_File( uFileToMove, uLocation )
	Check_Del_Move_File( vFileToMove, vLocation )
	Check_Del_Move_File( wFileToMove, wLocation )
	Check_Del_Move_File( xFileToMove, xLocation )
	Check_Del_Move_File( yFileToMove, yLocation )
	Check_Del_Move_File( zFileToMove, zLocation )
	Check_Del_Move_File( auFileToMove, auLocation )
	Check_Del_Move_File( buFileToMove, buLocation )
	Check_Del_Move_File( cuFileToMove, cuLocation )
	Check_Del_Move_File( duFileToMove, duLocation )
	Check_Del_Move_File( euFileToMove, euLocation )
	Check_Del_Move_File( fuFileToMove, fuLocation )
	Check_Del_Move_File( guFileToMove, guLocation )
	Check_Del_Move_File( huFileToMove, huLocation )
	Check_Del_Move_File( iuFileToMove, iuLocation )
	Check_Del_Move_File( juFileToMove, juLocation )
	Check_Del_Move_File( kuFileToMove, kuLocation )
	Check_Del_Move_File( luFileToMove, luLocation )
	Check_Del_Move_File( muFileToMove, muLocation )
	Check_Del_Move_File( nuFileToMove, nuLocation )
	Check_Del_Move_File( ouFileToMove, ouLocation )
	Check_Del_Move_File( puFileToMove, puLocation )
	Check_Del_Move_File( quFileToMove, quLocation )
	Check_Del_Move_File( ruFileToMove, ruLocation )
	Check_Del_Move_File( suFileToMove, suLocation )
	Check_Del_Move_File( tuFileToMove, tuLocation )
	Check_Del_Move_File( uuFileToMove, uuLocation )
	Check_Del_Move_File( vuFileToMove, vuLocation )
	Check_Del_Move_File( wuFileToMove, wuLocation )
	Check_Del_Move_File( xuFileToMove, xuLocation )
	Check_Del_Move_File( yuFileToMove, yuLocation )
	Check_Del_Move_File( zuFileToMove, zuLocation )
	' *** end of suggestion
End Sub
Public Sub Export()
	'aPath = ThisDoc.Path
	aPath = RuleArguments("aPath") ' *** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aPDF = ThisApplication.ApplicationAddIns.ItemById _
	("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
	aDocument = ThisApplication.ActiveDocument
	aContext = ThisApplication.TransientObjects.CreateTranslationContext
	aContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
	aPDFOptions = ThisApplication.TransientObjects.CreateNameValueMap
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	bFolder = aPath &amp;amp; "\" &amp;amp; "oud"
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName ' *** this variable is not used ***
	
	If aPDF.HasSaveCopyAsOptions(aDataMedium, aContext, aPDFOptions) Then
		aPDFOptions.Value("All_Color_AS_Black") = 1
		aPDFOptions.Value("Remove_Line_Weights") = 1
		aPDFOptions.Value("Vector_Resolution") = 4800
		aPDFOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
	End If
	
	aPDF.SaveCopyAs(aDocument, aContext, aPDFOptions, aDataMedium)
	' *** the follow code has been adapted on my suggested subroutines
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropRevNum &amp;amp; ".pdf")
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf")
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; " rev" &amp;amp; ".pdf")
	Check_Move_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf", _
					aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf")
	Check_Move_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf", _
				aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev-" &amp;amp; ".pdf", aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf", bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf" )
	Check_Del_File(aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf", _
				bFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf" )
End Sub

Sub Check_Del_File(oExist As String, oDelete As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oExist) = True Then
		System.IO.File.Delete(oDelete)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Sub Check_Move_File(oFileToMove As String, oLocation As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oFileToMove) = True Then
		System.IO.File.Move(oFileToMove, oLocation)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Sub Check_Del_Move_File(oFileToMove As String, oLocation As String) ' my suggestion
	'	Try
	If System.IO.File.Exists(oFileToMove) = True Then
		System.IO.File.Delete(oLocation)
		System.IO.File.Move(oFileToMove, oLocation)
	End If
	'	is a good practice to add an error control code
	'	    Catch e As Exception
	'            MsgBox("The process failed: {0}", e.ToString())
	'       End Try
End Sub

Public Sub Message()
	'aPath = ThisDoc.Path
	'aFolder = aPath &amp;amp; "\" &amp;amp; "DXF"
	aFolder = RuleArguments("aPath") &amp;amp; "\" &amp;amp; "DXF" ' *** my correction
	iPropParNum = iProperties.Value("Project", "Part Number")
	iPropRevNum = iProperties.Value("Project", "Revision Number")
	aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
	aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"
	aName = aDataMedium.FileName ' I don't think you need this line
	
	' *** this condition don't do nothing, may be contain an error***
	If iPropRevNum = "" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	Else If iPropRevNum = "-" Then
	aName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; ".pdf"
	End If
	' ***
	
	If Not aName = aFolder &amp;amp; "\" &amp;amp; ".pdf" Then
		question = MessageBox.Show("Het bestand is opgeslagen in " &amp;amp; aName _
		&amp;amp; vbNewLine _
		&amp;amp; vbNewLine &amp;amp; "Bestand openen?" , "Opgeslagen",MessageBoxButtons.YesNo,MessageBoxIcon.Question)
		If question = vbYes Then 
			ThisDoc.Launch(aName)
		End If
	End If
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know if you have troubles with this code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Sat, 08 Nov 2014 14:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5390563#M121888</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-08T14:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5392529#M121889</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Rossano Praderi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I appreciate the time and effort you're taking&amp;nbsp;to help me. Right now I am busy with other things at work,&amp;nbsp;but I will have a good look at your comment&amp;nbsp;this week! Just letting you know.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 10 Nov 2014 13:44:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5392529#M121889</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-10T13:44:06Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5395173#M121890</link>
      <description>&lt;P&gt;I tried it out but without success. If we could break it down in to opening drawings and exporting PDF's that would be easier for me to follow.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Well, i tried your rules but it only opens the models, not the drawings. And of course i tried to get it to work, but without any success. I've made some parts, assemblies and drawings with the rules in them, for you. I've made it so that it opens the models correctly but nothing more. If you could help me understand how to open the drawings that'd be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm sorry if my English isn't always accurate.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 12:52:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5395173#M121890</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-11T12:52:46Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396661#M121891</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;thank you for give me these files, now I can test the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my last post I haven't checked the rule for which kind of document would be open. I thought this part of code should be correct.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course you english is better than my.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 22:05:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396661#M121891</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-11T22:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396683#M121892</link>
      <description>No problem! I'm trying to open the drawings from an assembly.&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Tue, 11 Nov 2014 22:12:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396683#M121892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-11T22:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396703#M121893</link>
      <description>Oops, d182284 is my account i got from school. Accidentally signed in on it.</description>
      <pubDate>Tue, 11 Nov 2014 22:17:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5396703#M121893</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-11T22:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5402561#M121894</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;this is your code, you have to make some modifications on the external rule "Export - Pdf in assembly".&lt;/P&gt;&lt;P&gt;With this rule you can open all the connected .idw, is a good idea to check if the file exist before launch it (this is missed in your code).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments

'the following two lines are necessary to pass arguments to the external rule
'Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
'map.Add("aPath", ThisDoc.Path)
'map.Add("aFullFileName", "")

For Each oOcc In oRefDocs
	' open the .idw of each referenced document
	ThisDoc.Launch(oOcc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value &amp;amp; ".idw")
	'ThisDoc.Launch(ThisDoc.Path &amp;amp; "\" &amp;amp; oOcc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value &amp;amp; ".idw") ' with fullpath
	' Here you can run your PDF rule (remember to pass the fullfilename of your .idw as argument)
	' your external "open" rule is unnecessary
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2014 22:09:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5402561#M121894</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-13T22:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5407767#M121895</link>
      <description>&lt;P&gt;Awesome, that works great!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what I did; i stripped it down to this code (because I like to keep it simple):&lt;/P&gt;&lt;PRE&gt;Dim oAsmDoc As AssemblyDocument = ThisApplication.ActiveDocument
Dim oRefDocs As DocumentsEnumerator = oAsmDoc.AllReferencedDocuments
Dim map As Inventor.NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap()
map.Add("aPath", ThisDoc.Path)
For Each oOcc In oRefDocs
	ThisDoc.Launch(oOcc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value &amp;amp; ".idw")
	iLogicVb.RunRule("PDF", map)
Next&lt;/PRE&gt;&lt;P&gt;and this one for PDF export:&lt;/P&gt;&lt;PRE&gt;aPath = RuleArguments("aPath")
aDocument = ThisApplication.ActiveDocument
iPropParNum = iProperties.Value("Project", "Part Number")
iPropRevNum = iProperties.Value("Project", "Revision Number")
aPDF = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
aContext = ThisApplication.TransientObjects.CreateTranslationContext
aContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
aPDFOptions = ThisApplication.TransientObjects.CreateNameValueMap
aDataMedium = ThisApplication.TransientObjects.CreateDataMedium
aFolder = aPath &amp;amp; "\DXF"
bFolder = aPath &amp;amp; "\oud"
aDataMedium.FileName = aFolder &amp;amp; "\" &amp;amp; iPropParNum &amp;amp; " rev" &amp;amp; iPropRevNum &amp;amp; ".pdf"

If aPDF.HasSaveCopyAsOptions(aDataMedium, aContext, aPDFOptions) Then
	aPDFOptions.Value("All_Color_AS_Black") = 1
	aPDFOptions.Value("Remove_Line_Weights") = 1
	aPDFOptions.Value("Vector_Resolution") = 4800
	aPDFOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
End If

aPDF.SaveCopyAs(aDocument, aContext, aPDFOptions, aDataMedium)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It opens and generates the PDF correctly. Except, it doesn't save the PDF with the right part number. I've tried some things, but didn't succeed again &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; . I'm really trying to understand it, but I'm new to it and it's still a bit complicated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2014 08:36:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5407767#M121895</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-17T08:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5409383#M121896</link>
      <description>&lt;P&gt;Hi Stan,&lt;/P&gt;&lt;P&gt;you didn't checked my last posts, if you will do it, you will find the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this modifications.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;map.Add("aPath", ThisDoc.Path)&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;map.Add("aFullFileName", "")&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;
For Each oOcc In oRefDocs
&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;        map.Value("aFullFileName")= oOcc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value &amp;amp; ".idw"
        ThisDoc.Launch(RuleArguments("aFullFilename"))&lt;/SPAN&gt;&lt;/STRONG&gt;
        iLogicVb.RunRule("PDF", map)
Next&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;aPath = RuleArguments("aPath")
&lt;STRONG&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim aDocument As inventor._Document=ThisApplication.documents.itembyname(RuleArguments("aFullFileName"))
'aDocument = ThisApplication.ActiveDocument&lt;/SPAN&gt;&lt;/STRONG&gt;
iPropParNum = iProperties.Value("Project", "Part Number")
iPropRevNum = iProperties.Value("Project", "Revision Number")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't check the rest of your code, if read carefully you will learn something new &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Bregs&lt;/P&gt;&lt;P&gt;Rossano Praderi&lt;/P&gt;</description>
      <pubDate>Mon, 17 Nov 2014 19:46:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5409383#M121896</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-17T19:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5410505#M121897</link>
      <description>&lt;P&gt;Dshortway,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for taking the time, and you're a great teacher also haha. I do understand it now, first i wasn't sure how to handle the maps.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Stan&lt;/P&gt;</description>
      <pubDate>Tue, 18 Nov 2014 10:22:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5410505#M121897</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-18T10:22:08Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5411809#M121898</link>
      <description>You are welcome.</description>
      <pubDate>Tue, 18 Nov 2014 18:05:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5411809#M121898</guid>
      <dc:creator>rossano_praderi</dc:creator>
      <dc:date>2014-11-18T18:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic problem</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5423803#M121899</link>
      <description>&lt;P&gt;Hi, thanks for all great codes here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on creating a template for in.ex a HVAC Flange, that can be changed by using ilogic : if/elseif and True/False etc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/143217i954ABC738D44FEF8/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" title="flange.jpg" alt="flange.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have allready "standard" assemblys with idw drawings ready for the Flanges&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to add the possibility that when you choose one of the flanges, that the .idw file from the standard assembly will be opened (from outside project folder) and a pdf. will be generated and copied into my project folder with a new prefix in the filename.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in ex.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have my ilogic configurator called:&lt;/P&gt;&lt;P&gt;L1234_000_Flange ø300.ipt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the .idw I want to copy from is named&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;_Flange ø300.idw&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and I want the pdf to take the prefix on my configurator and add it to the pdf like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;L1234_000_Flange ø300.pdf&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and If i for some reason change the configurator it will delete the previous one and replace with new pdf&lt;/P&gt;&lt;P&gt;in.ex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;L1234_000_Flange ø500.ipt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;_Flange ø500.idw&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;to:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;L1234_000_Flange ø500.pdf&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Is this possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2014 14:09:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/ilogic-problem/m-p/5423803#M121899</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2014-11-25T14:09:19Z</dc:date>
    </item>
  </channel>
</rss>

