AutoCAD Inventor :: ILogic To Save Multiple Formats

Mar 1, 2013

I have the following

strFile = ThisDoc.FileName(False) & "-Rev " & iProperties.Value("Project", "Revision Number")ThisDoc.Document.SaveAs(strFile & (".dwg"), True)ThisDoc.Document.SaveAs(strFile & (".pdf"), True)

And it works like a charm for pdf, but it does not export to .dwg?

And also, is it possible to decide where in the name the "-Rev " &iPro....should appear?

Ex. if the filename should be : "12345 - Rev 02 - Section cut"

View 1 Replies


ADVERTISEMENT

AutoCAD Inventor :: ILogic Save Drawing As DWG

Apr 24, 2012

Is there a way in an inventor drawing rule to do a "save as" which saves the drawing as an Inventor dwg file rather than an AutoCAD dwg file?

The below saves as AutoCAD which is ok but I need the outputted drawing to be linked to the model. I don't want the code to save the entire assembly as this is done further down the line. I also don't want to save the current inventor dwg drawing from which the rule is run as this is just a template drawing.
 
ThisDoc.Document.SaveAs(ThisDoc.Path&"2D_DRAWINGS"&iProperties.Value("Custom", "Drawing No.")&" (Rev "&Parameter("BEAUFORT_ARRANGEMENT_3.iam.DRAWING_REVISION_NO")&")"&".DWG", True)

View 1 Replies View Related

AutoCAD Inventor :: ILogic - Save As PDF Rule

Oct 24, 2012

I'm currently using this rule for easy PDF making

SaveLoc = "C:Temp"FileName = ThisDoc.FileName(False)Revnr = " rev_" & iProperties.Value("Project", "Revision Number")PDFnaam = SaveLoc & FileName & RevnrThisDoc.Document.SaveAs(PDFnaam & (".pdf") , True)MessageBox.Show("PDF is aangemaakt in C:Temp", "Document creation",MessageBoxButtons.OK,MessageBoxIcon.Information)

 The problem with this is that i want to save without lineweight? is there anyway to do this with this code?

View 2 Replies View Related

AutoCAD Inventor :: ILogic Save As Command?

Aug 3, 2010

I want a part automatically to be "saved as" in my workspace.

there is the command

ThisDoc.Document.SaveAs(NewFileNameAndExtension , True)

in the browser of iLogic but I don't know how to use it.

I tried ThisDoc.Document.SaveAs("partname.iam", True)

but that's couases a error.

View 4 Replies View Related

AutoCAD Inventor :: ILogic - Save As IProperty

Apr 11, 2013

I have a template part that I would like to save automatically once the parameters dialog box is closed.  I would also like the Save As filename to automatically be filled in with a iProperty named "Part Name".  I already have the "Part Name" description grabbing information from parameters.  Is this possible? And is the best way to trigger the event after an "iProperty change" or "Any Model Parameter Change"?

View 1 Replies View Related

AutoCAD Inventor :: Use ILogic To Do File Save As?

Dec 3, 2010

I would like to use iLogic to do a File Save As and have the dialog box open in a specified folder.  I have tried the code below but it doesn't work. 
 
oFileDlg.InitialDirectory = "J:" & strFolder & (".dwg")
oFileDlg.ShowSave()

View 2 Replies View Related

AutoCAD Inventor :: Rename And Save Using ILogic?

Sep 13, 2011

I am having a bit of trouble finding the correct code for some automated ilogic in inventor 2011.

I am trying to achieve an automated rename and save process for an assembly file as well as the variable parts in the file.an example would be a steel column...

Open ilogic steel column, run rules to change column length and section size...then save a copy to workspace, but also to a specific folder in the workspace..also rename the column file and save.

i have this for file saving -

SyntaxEditor Code Snippet
Test=InputBox("Add File name", "Please Add your file name", "Prefix number - File - .iam")
ThisDoc.Document.SaveAs(ThisDoc.WorkspacePath()&Test, True)

Which works fine to save the new assembly, but i need the same for the variable column within the assembly, and also to save to a specific folder not just the workspace top level.

View 9 Replies View Related

AutoCAD Inventor :: ILogic To Save PDF In 2 Locations

Dec 18, 2013

I'm trying find some code that will allow me to save a PDF in 2 different locations. 

I want to save a copy on my C: drive - this part has been done, but I'd like the code expanded to save a copy on the F: drive (under a similar path to that on the C: drive.

For example, for drawing XXX-XXX.dwg (C:Vault WorkspaceCADSalesEnquiries201313-XXXDrawings), I would like a PDF created in C:Vault WorkspaceCADSalesEnquiries201313-XXXDrawingsPDF  (this part has been done) and i would also like a copy saved in F:SalesEnquiries201313-XXXDrawingsPDF.

I do not know which will be easier; to create 2 PDFs, or create 1 and copy it to F:

View 2 Replies View Related

AutoCAD Inventor :: ILogic To Save DWG But Not Model?

Oct 25, 2013

I currently have ilogic code that automatically saves a template Inventor dawing as a job drawing. However the problem I am having is when it does this save it takes forever as it seems to be also saving the linked model also. Is there a way to save this Inventor dwg without saving the linked model? The reason why I do not want this model save is because after the drawing is outputted the user is given options to write part numbers and dxf files if required which requires a model save anyway.

Sample of code used:-

ThisDoc.Document.SaveAsInventorDWG(ThisDoc.Path & "2D_DRAWINGS (Inventor dwg)" & iProperties.Value("Custom", "Drawing No.") & ".DWG", True)

View 1 Replies View Related

AutoCAD Inventor :: ILogic Form With Multiple Forms?

Oct 25, 2012

I would like to know if it is possible to make a form with multiple forms, depending on the selection a could build a rectangle, or a cilynder or a cone.

View 3 Replies View Related

AutoCAD Inventor :: ILogic Save File Crashes?

Sep 5, 2012

I seem to have my task accomplished, but Inventor crahes on me after it is done.

Here is how my iLogic works. 

' Deleting the suppressed parts from the assembly
Dim compDef as AssemblyComponentDefinition
compDef = ThisDoc.ComponentDefinition
Dim compOcc as ComponentDefinition
For Each compOcc in compDef
[Code] ........

Now as soon as the last line is executed, Inventor crashes.

But when I go to the save file part (C:MyPath), both the parts and assembly files are saved and if I open it, they work just fine.

I just can't get inventor to stop crashing.

View 7 Replies View Related

AutoCAD Inventor :: Save PDF Using ILogic And Name After Revision Number?

Jul 7, 2011

My question: We want to use iLogic to save a PDF-file of the DWG-drawing every time we hit "save". We now use the following iLogic

Spoiler (Highlight to read)oPath = ThisDoc.Path PN = iProperties.Value("Project", "Part Number")
PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext

[Code] .....

View 9 Replies View Related

AutoCAD Inventor :: Selecting Save As Directory With ILogic?

Oct 25, 2012

I am making some iLogic automated parts which I want to save when I place them in an assembly.

Now I have the folder the file needs to be saved in allready specified in the simple code I wrote but I want to be able to browse the folders to select a specific one.

I run the code by activating it in a Form that pops up when you place the part in an assembly.

The simple save as code I wrote is as following:
 
Workspace = ThisDoc.WorkspacePath()If System.IO.File.Exists(Workspace & "Parts" & "Cable Tray-" & Partnumber & ".ipt") = True Theni = MessageBox.Show("The partnumber you chose is allready in use, choose an other number.", "Save Error", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1)Else If System.IO.File.Exists(Workspace & "Parts" & "Cable Tray-" & Partnumber & ".ipt") = False ThenThisDoc.Document.SaveAs(Workspace & "Parts" & "Cable Tray-" & Partnumber & ".ipt", False)End If
 
How I can browse the folders to select the folder to save the part in when placing the part?

View 9 Replies View Related

AutoCAD Inventor :: ILogic - Save All To User Specified Location

Sep 9, 2013

I´m trying to create an external iLogic rule that let´s the user specify a path and saves an assembly and all it´s components into one directory. Alternatively it could be the main workspace path which doesn´t have to be specified by the user so it can be handled internally.

The background is a design template that resides on a network storage which can be configured through an iLogic Form and when the user is done configuring the assembly to it´s liking it should be saved to it´s workspace.

I was looking through the snippets but couldn´t find anything related to "save all". I have the feeling that I have to cycle through all component occurences and save them one by one.

Getting a Save As dialog box seems to be possible as I could see on Curtis Waguespack´s blog but the commands he is using are nowhere documented. For example for calling the dialog box he is using

InventorVb.Application.CreateFileDialog(oFileDlg)

View 2 Replies View Related

AutoCAD Inventor :: ILogic Excel Save As Command

Dec 12, 2012

I have an ilogic rule to open an existing excel file template and export the inventor parameters into it. I am trying to find a way to then save the excel file as a different filename. This way the original template can stay unmodified. I have found the GoExcel.save command but is there some sort of GoExcel.saveas(filename, filepath) command?

View 2 Replies View Related

AutoCAD Inventor :: ILogic Rule Will Always Accept Save Regardless Changes Or Not

Mar 14, 2013

I am not good with iLogic but I have this rule that gives me length and width of a sheetmetal part in mm and with , (comma). The rule works but the file will always accept saving regardless if there has been changes or not. I want the rule to only accept save IF there has been changes on SM_Length (=<FLAT PATTERN LENGTH> cm) and SM_Width (=<FLAT PATTERN WIDTH> cm) or Thickness.

sLength = iProperties.Value("Custom", "SM_Length")

sWidth = iProperties.Value("Custom", "SM_Width")

sThickness = iProperties.Value("Custom", "Thickness")

[code]....

Autodesk Inventor/Vault Professional 2013

View 3 Replies View Related

AutoCAD Inventor :: Save Copy And Replace With ILogic

Dec 18, 2013

I have an assembly that I am working on that will be used as a configurator, driven by I-logic. Everything is work fine but there is one part off the assembly that will be custom to each new assembly.  Is there a way to use I logic  to open the ipt file save it as copy with different name and replace the original in the assembly. I know this can be done manual through the productivity tab within the assembly environment, but I am trying to automate the process so the end user will just have to follow prompts that will be given by i-logic.

View 4 Replies View Related

AutoCAD Inventor :: Multiple Identical ILogic Sub-assemblies With Different Parameters

Jul 17, 2013

iLogic code question concerning how Place iLogic Component and retain the ability to push parameters from the subassemblies to the parts after being renamed.

I have ASSEMBLY.iam containing:

SUBASSEMBLY-01:1.iam
SUBASSEMBLY-02:1.iam
and sometimes SUBASSEMBLY-02:2.iam

each SUBASSEMBLY.iam contains PART1.ipt and PART2.ipt which have variable LENGTH and WIDTH. LENGTH and WIDTH are entered manually at the SUBASSEMBLY.iam and are infinitely variable.

To transfer the parameters I'm using iLogic code in the SUBASSEMBLY:

 Parameter("PART1.ipt", "LENGTH")=LENGTHParameter("PART1.ipt", "WIDTH")=WIDTHParameter("PART2.ipt", "LENGTH")=LENGTHParameter("PART2.ipt", "WIDTH")=WIDTH
 
Issue 1: When I place the SUBASSEMBLY as an iLogic Component, the parts are renamed to PART1-01.ipt which renders my Parameter transfer useless. What am I missing on writing this code so it can find the new part name?

 Issue 2: I like the automatic renaming that happens with Place iLogic Component. Is there a better way to handle this automatically through Place Component -> Save & Replace?

Inventor 2013

View 1 Replies View Related

AutoCAD Inventor :: ILogic / Use Same Variable In Multiple Subs / Functions?

Apr 10, 2013

I have an iLogic rule in which I'm trying to set three user parameters for the gage of each leg of a steel angle. I want Inventor to set the gage based on the length of each leg. Here's the table I referenced for gages: [URL].

In my code, I have a sub called DetermineGage which takes the leg length, whether it's the short leg or the long leg, and determines the gages that should belong to that leg. Inside of that sub it calls on a sub called ApplyGage which then applies the determined gage to the rule's gage variables. The main sub then grabs those variables and applies those values to the actual user parameters.... In theory.

The rule executes ok with no errors, but doesn't change the value of the user parameters; they're always "0". As best I can tell, the "oGage" variables I used in the rule don't even get assigned the correct value, which makes me think the DetermineGage and ApplyGage subs can't even access the oLegLength or oGage parameters to read or set them. I don't want to use global parameters because I've heard that can make programs very unstable over time and is just bad practice. How can I make these variables accessible to all subs IN THIS RULE, no more no less?
 
Sub Main()Dim oLegShort As Double = Min(G_W,G_H)Dim oLegLong As Double = Max(G_W,G_H)Dim oLegLength As DoubleDim oGage As DoubleDim oGage1 As DoubleDim oGage2 As Double'Short Leg:oLegLength = oLegShort'Call DetermineGages sub to set oGage variables:DetermineGages()On Error Resume Next'If gage parameter does not equal true gage, set it equal:If Parameter("ShortLegGage") <> oGage ThenParameter("ShortLegGage") = oGageEnd If'Assume error means gage parameter does not exits. Create and set equal to true gage:If Err.Number <> 0

[code]...

View 9 Replies View Related

AutoCAD Inventor :: Create Listbox In ILogic That Allows For Multiple Selections?

Oct 3, 2013

How do I create a listbox in iLogic that allows for multiple selections?

View 3 Replies View Related

AutoCAD Inventor :: Very Slow ILogic Functions With Multiple Processes?

Mar 22, 2013

how the internals of Inventor / iLogic are working.

We have multiple instances of Inventor running on a 12 core workstation so we can push configurations through concurrently  - each Inventor instance is assigned its own processor affinity and each instance has its own project which points to seperate directories of Inventor models.

Everything seems to work OK when there are up to 5/6 working concurrently, but as soon as there are more than 6 the iLogic functions seem to grind to a halt - note that the rules are external rules.
 
For example, this function took 11 seconds to complete when there were 10 concurrent orders processing. :
 
Parameter("BLANK", "EDGE_FRT_ACTIVE") = "YES"
 Similarly these functions took 11 seconds in total to complete :
 
iProperties.Value("Custom", "M1110900_P1PO") = iProperties.Value("Custom", "BLANK_GDIM") - iProperties.Value("Custom", "PANEL_GDIM")iProperties.Value("Custom", "M1110900_P2PO") = iProperties.Value("Custom", "BLANK_XGDIM") - iProperties.Value("Custom", "PANEL_XGDIM")iProperties.Value("Custom", "M1110900_P1OR") = 1iProperties.Value("Custom", "M1110900_P2OR") = 0
 
When I run these with less that 6 concurrent Inventor processes, they're are almost instant.

I just don't know where the bottleneck is. I've ruled out :

- Processor (each core never reaches above around 60%)

- RAM (we've got 48GB of RAM, with about 15GB free at worst)

- Disk (disk IO is busy, but it doesn't look like it's the bottleneck)

- Graphics (Inventor is in silent mode, with no UI, so graphics activity is minimal)

From the tests I've done it seems to be the iLogic functions that are the bottleneck. My next port of call is to change the iLogic functions to actual API calls, but I suspect I'll get the same results.

So, my questions :

Is Inventor queing these iLogic API calls somehow (note we're creating a unique instance of the Inventor.Application COM object for each processing thread) ?

Is there an issue with using external rules with nultiple instances?

Dell Precision R5500, Intel Xeon X5690 3.47GHz (x2)
48GB RAM
Inventor 2013 (PDS Premium)
64bit Windows 7 SP1

View 4 Replies View Related

AutoCAD Inventor :: Copy ILogic Rule To Multiple DWG Files

Feb 14, 2012

I have the need filter inside Vault the Inventor Drawings (.dwg/.idw) by its papersize.

In my testing enviroment, I created a iLogic rule inside a .idw with the following

iProperties.Value("Custom", "Formato") = ActiveSheet.Size

I used the Ruler Trigger "After Save Document" to refresh this rule.

In Vault, I've mapped this custom property:

But, how to Copy (and update) this iLogic Rule to the other existing .dwg files in Vault?

I thought the iLogic Design Copy would be able to do so, but it doesn't works in that way.

View 6 Replies View Related

AutoCAD Inventor :: ILogic Replace Component With Multiple Different Components

Jan 5, 2014

So I have been going round and round in circles on this one iam trying to use replace component within ilogic which is fine with switching one part for another but I want a drop down of parts so it replaces which ever one is active the problem I am having is establishing which one is active. So below is what I have so far but the problem is you cant seem to reference a part that is not in the assembly so I keep getting the error

The component named "Flange 1" was not found for example. I just need a way of establishing which one is currently in the assembly but with out referencing components that are not there.

If Component.IsActive("Flange 1")=True Then current = 1
If Component.IsActive("Flange 2")=True Then current = 2
If Component.IsActive("Flange 3")=True Then current = 3
If part = 1 And current = 2 Then Component.Replace("flange 2", "Flange 1.ipt", True) End If
If part = 1 And current = 3 Then Component.Replace("flange 3", "Flange 1.ipt", True) End If
If part = 2 And current = 1 Then Component.Replace("flange 1", "Flange 2.ipt", True) End If
If part = 2 And current = 3 Then Component.Replace("flange 3", "Flange 2.ipt", True) End If
If part = 3 And current = 1 Then Component.Replace("flange 1", "Flange 3.ipt", True) End If
If part = 3 And current = 2 Then Component.Replace("flange 2", "Flange 3.ipt", True) End If

View 4 Replies View Related

AutoCAD Inventor :: Open Word File And Save As From ILogic / VBA?

Nov 14, 2013

We have a word file that we use a lot for our drawings.  There is an empty file that we open and then save the file into the same directory as the drawing.

I am trying to setup some code that will open the empty Word File, and then bring up the Word Save As dialog box with the correct directory and file name already completed.  The correct directory and File name will be determined by the Drawing Code.

I have been able to open the Empty Word Document from iLogic with the following
 
'CRS Template Path & File NameoCRSTemplate = "\WWSERVERDisplaysA-Z Stand PartsCRS-Template.doc" 'Publish document. ThisDoc.Launch(oCRSTemplate)
 
I have been able to Open the Empty Word File from VBA and then bring up the Word Save As Dialog Box but I cannot work out how to define the initial directory or the initial file name from Inventor.

This is the VBA Code I have been using top open the Empty Word File and Show the Word Save As Dialog Box:

Public Sub OpenCRSDoc1()
'Don't Forget to Add the Word Object Library in the Tools - References
' Call SetCRSDetails

[Code].....

If you try to use the With Command for the FilePicker it will just open the Word Document and NOT the Save As Dialog Box!!!

Example of the With Tried

With FilePicker
.InitialDirectory = "Z:"
.DialogTitle = "Hello"
.Show
End With

How to open a Word Document from either iLogic or VBA (VBA Preferred) and then open the Word Save As Dilog Box and define the Initial Directory and Filename?

View 1 Replies View Related

AutoCAD Inventor :: Update And Save Assembly Through ILogic In Drawing?

Jul 10, 2013

as a part of automating manufacturing drawings, am trying to include ilogic code in the drawing , that would accept values from the user and store it as "user parameters" and make corresponding changes in the inventor drawing file.So, to replicate my issue on a smaller scale, i had created 2 parts and created an assembly out of these 2 parts. I used the assembly in my drawing.

In the Drawing i created a user parameter .. say "external_param". I am opening the drawing and changing the value of the user parameter through the (Fx) parameter table. 

doc = ThisDoc.DocumentIf external_param >= 50 And external_param <= 99 ThenParameter("block_1.ipt.d0") = 15 'change the length of the blockParameter("block_1.ipt.d14") = 3 'change the number of holes in the blockElseIf external_param >= 100 And external_param <= 199 ThenParameter("block_1.ipt.d0") = 40Parameter("block_1.ipt.d14") = 5ElseIf external_param >= 200 And external_param <= 299 ThenParameter("block_1.ipt.d0") = 80Parameter("block_1.ipt.d14") = 6ElseIf external_param >= 300 And external_param <= 399 ThenParameter("block_1.ipt.d0") = 160Parameter("block_1.ipt.d14") = 9End IfRuleParametersOutput()iLogicVb.UpdateWhenDone = True'InventorVb.DocumentUpdate()
 
As you can see, i have commented out InventorVb.DocumentUpdate() , im not quite sure what would accomplish the update and save of the assembly document in the background (without prompting for a save/update). I have also tried thisDoc.Save and thisdoc.update. Using these 2 commands along with the InventorVb.DocumentUpdate() or iLogicVb.UpdateWhenDone caused Inventor to Crash.

View 4 Replies View Related

AutoCAD Inventor :: ILogic Save As Using Vault Numbering Scheme

Apr 11, 2012

I am trying to create a baseline assembly driven by ilogic.  When the baseline gets changed, most of the parts get replaced, but a few change size.  I would like to re-name the top level assembly, as well as the parts and sub assemblies that change.  We use a Vault sequential numbering scheme.  How do I extract the next number from the sequence from Vault in iLogic?

View 2 Replies View Related

AutoCAD Inventor :: ILogic Save As PDF Color Option Not Working

Jan 16, 2012

I want to save my PDFs as All Colors As Black, but setting the option to 0 or 1 doesn't work, it keeps saving the PDFs in color. Here's the snippet of

 If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_As_Black") = True
oOptions.Value("Remove_Line_Weights") = False
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'oOptions.Value("Custom_End_Sheet") = 4
End If

What is wrong with the option in the second line (shown in red)? I've tried a few other variations of All_Color_As_Black, but I'm having no joy. All the other examples I've looked at either has that option set to False (0) or that line is commented out .

View 4 Replies View Related

AutoCAD Inventor :: Export ILogic Form And Save It Externally

Oct 30, 2013

Is there anyway to export an iLogic form and save it externally?

View 3 Replies View Related

AutoCAD Inventor :: Opening Model With ILogic And Save As STP File?

Jul 23, 2012

I have an ilogic rule created to do a save as .dxf and .pdf from the .idw file.  It will then open the .ipt file without any issues.  The problem I am having is that I also want it to do a save as .stp of the model after it opens the model.  I get the following error.

Error in rule: Save As DXF PDF and open, in document: Save As DXF PDF and open.iLogicVb

Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

Do I need to add something to the code?

Here is the code I have written.
 
strFolder="C:Vault_WorkspaceSave As"&iProperties.Value("Project", "Part Number")
ThisDoc.Document.SaveAs(strFolder&"_Rev"&iProperties.Value("Project", "Revision Number")&(".dxf") , True)
ThisDoc.Document.SaveAs(strFolder&"_Rev"&iProperties.Value("Project", "Revision Number")&(".pdf") , True)
doc=ThisDoc.PathAndFileName(False)&".ipt"ThisDoc.Launch(doc)
strFolder="C:Vault_WorkspaceSave As"&iProperties.Value("Project", "Part Number")
ThisDoc.Document.SaveAs(strFolder&"_Rev"&iProperties.Value("Project", "Revision Number")&(".stp") , True)
MessageBox.Show("STEP Created", "File Save")

View 1 Replies View Related

AutoCAD Inventor :: ILogic - Save To Specific Folder Within Workspace

Mar 15, 2013

Is it possible to automatically divert Inventor to save to a specific folder within the workspace???

If a certain iProperty is set to yes, we want the user to save that file into a particular folder, if they try and save it elsewhere a message is popped up telling them an error has been made please try and save in the correct folder.

Admittedly I am not the most competant iLogic programmer but this is what I have thus far

Format:HTML Format Version:1.0 StartHTML:     165 EndHTML:    5388 StartFragment:     314 EndFragment:    5356 StartSelection: 314 EndSelection:     314
SyntaxEditor Code Snippet
WorkspacePath=ThisDoc.WorkspacePath()
DrawingPath="C:Live WorkSpaceDesigns3D Designs3D Drawings"

[Code] .......

View 4 Replies View Related

AutoCAD Inventor :: ILogic - Assembly Rule To Multiple BOMQuantity In Parts

Oct 9, 2013

I have used Inventor for quite a while but never for much more than the odd 3D model.

I have recently created templates that allow me to use Inventor to create detailed fabrication drawings rather than relying on AutoCAD. But I have run across a question with regards to the BOM. Let me try and explain my issue.

I currently create assemblies for fabricated items. However, in the complete (or top level assembly) there may be multiple fabricated items (assemblies required). At the moment I create the BOM and manually edit the quantities required to reflect the number of assemblies (and resulting parts) that are required.

In my assembly file I created a parameter called "AssemNo" which is meant to reflect the number of assemblies required. In my part files I created a parameter called "AssemQty". I would insert the following iLogic code for each part in the assembly:

quantity - This.BOM.CalculateQuantity("Model Data", "PartNumber")*AssemNo
Parameter("Part Name:1", "AssemQty") = quantity

This works but it requires me to create that line of code for every part in my assembly. I know an iLogic code can be created to search an assembly and change parameters of all parts (see below as an example to copy Occurence name to iProperties >

' set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
    Dim oName As String
    oName = oOccurrence.Name
    iProperties.Value(oOccurrence.Name, "Project", "Part Number") = oName
    MessageBox.Show(oOccurrence.Name, "iLogic")
Next

Can the two be combined?

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved