File rename popup

File rename popup

Welbilt_Designer_3
Enthusiast Enthusiast
1,896 Views
13 Replies
Message 1 of 14

File rename popup

Welbilt_Designer_3
Enthusiast
Enthusiast

The company I work for has many designers all using the same prototype parts. I have been tasked with creating new prototypes and preventing them  from being altered without renaming. What I want to do is create a popup window when the part is inserted into an assembly. I have no issue doing this however, I would like to include a space to enter the new part name in the popup. Any ideas? 

0 Likes
Accepted solutions (1)
1,897 Views
13 Replies
Replies (13)
Message 2 of 14

Mark.Lancaster
Consultant
Consultant

@Welbilt_Designer_3

 

Welcome to the community..

 

Just so I understand your requirements.  Are you saying when this parts get placed into an assembly you want to rename them then?

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 3 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

Correct, we don't want users to make changes to the parts in the prototype folder so currently we manually rename them when we place them. The problem is that some forget to rename the parts and end up altering the prototype when adjustments are made.

0 Likes
Message 4 of 14

Mark.Lancaster
Consultant
Consultant

@Welbilt_Designer_3

 

Why don't you define a library path to these secured files in your Inventor project file or set standard Windows security on these files.   If you use the former, Inventor locks them down.  Its not a true read-only but it prevents the users from saving/modifying the files.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

Message 5 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

We have them stored on a server and they are protected form being altered directly but they do sometimes end up being changed from time to time. Our IT department is looking into it. Also, we use the same part for different sizes so if I bring in 2 of the same 46"prototypes and need to change one to 36" I need a new name on the part so the other is not changed along with it.

0 Likes
Message 6 of 14

Mark.Lancaster
Consultant
Consultant

@Welbilt_Designer_3

 

Sounds like you need to make a custom iPart configuration..  That way when its placed you can save it and define its location.  But only speculating at this point since I don't know what your overall design is.   Not sure what you know about iParts but if not you can start at 3:30 in this video.

Mark Lancaster


  &  Autodesk Services MarketPlace Provider


Autodesk Inventor Certified Professional & not an Autodesk Employee


Likes is much appreciated if the information I have shared is helpful to you and/or others


Did this resolve your issue? Please accept it "As a Solution" so others may benefit from it.

0 Likes
Message 7 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

We build walk in coolers, each cooler has its own project folder with all of its parts and sub assembly's. As components are placed in the assembly from the prototypes folder we change the name: W-1, W-2 etc. each part needs a new name so it's size can be altered without changing the rest. With all of the different size possibilities we cannot have a separate part for each possibility. Therefore we use one wall panel that can be configured to any specification.

 

All I want to do is have a form pop up when the part is placed that allows us to enter the new name at that point to both save time and prevent accidental overwriting of the original, which I agree should be locked down better. I can make a form pop up when the part is placed my question is, Is there a way I can link the "save as" function to the form?

0 Likes
Message 8 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

"All I want to do is have a form pop up when the part is placed that allows us to enter the new name at that point to both save time and prevent accidental overwriting of the original, which I agree should be locked down better. I can make a form pop up when the part is placed my question is, Is there a way I can link the "save as" function to the form?"

 

 

Sorry, I meant Save Copy as.

 

I understand the advantages of Iparts but With the complexity of our parts, the automation program that mostly puts our assemblies together, and the ease of our "Panel Editor" tool they are just not the best fit for our current needs.

 

As an example we will use the wall panel again since it is the simplest panel we have, there are both male and female genders for each side of the wall panel that can be changed as needed. there are standard and reversed lock arrays that the user can turn on and off by selecting the number of each that they need in Parameters with rules that will not allow more locks to be turned on than will fit the size panel they are on, and much more. I could go on but you can begin to see that the number of coulombs in an IPart would become cumbersome not to mention that our automation program would not be able to modify the parts if we were to make them into IParts. 

 

I know that I can add a form that pops up when a panel is placed into an assembly and I can make it display a field that allows me to change parameters but I need it to change the parts name.

 

So, I am back to my original question. Is there a way I can link the "save Copy as" function to the form? or another way to prompt a "rename / save copy as" when placing a panel.

0 Likes
Message 9 of 14

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi WelbiltDesigner,

 

You can search and ask programming questions of this type on the Inventor Customization forum:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

Yes you can automate the Save Copy As process, but we'd probably need more information in order to supply an answer. It's sounds like you already have some automation in place, but it's not clear what is automated already as far a placing components, etc.

 

Here is an iLogic example:

http://inventortrenches.blogspot.com/2012/10/ilogic-adding-save-as-dialog-box.html

 

Also you can create custom iParts that allow you to place "on the fly" variations of your iPart, so you need to have every variation accounted for as rows in the iPart table.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

0 Likes
Message 10 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

Thanks Curtis,

 

The iLogic example you provided works great, I added it as a rule and linked the rule to a form that is set to activate when placed in the assembly.

 

The iLogic seems to be designed to place the newly saved file in the project folder and it does that perfectly, but it also puts the original in the assembly which I need to prevent.

 

Now I would like to take it one step further and have it also place the newly saved part into the assembly without having to place it, is that possible?

0 Likes
Message 11 of 14

Welbilt_Designer_3
Enthusiast
Enthusiast

I spoke too soon, it does put the new panel in the assembly but it still has the old name in the assembly list "C-Test" even though the part in the Project folder has the new name "C-6, C-7, etc.", Since our BOM generator needs the new name, I would like to have that change as well.

0 Likes
Message 12 of 14

Curtis_Waguespack
Consultant
Consultant

Hi WelbiltDesigner,

 

I'm lost on where you are with this, as it was never really clear how you were getting the components placed, etc. but here is an example that uses a hard coded path to a component (you can adjust that as needed).

 

This example:

  • prompts the use for a new name,
  • then places instances of the component based on the user's clicks,
  • then does a save copy as to create a new component (in the same directory as the active document, which would be the assembly),
  • and then replaces the placed instances with the saved copy.

In the future ask programming questions of this type on the Inventor Customization forum, and try to provide more clear examples of what you have already, etc. :
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

' Specify "library" file to be added
Dim sFile1 As String 
sFile1 = "C:\TEMP\Cube1.ipt"

'get file extension
sExtention = Right(sFile1,4)
'get name of file. to use in input box
sDefaultName = Right(sFile1, InStrRev(sFile1, "\")+1) 
'trim off extension from name
sDefaultName = Left(sDefaultName,Len(sDefaultName)-4)

sNewName = InputBox("Enter new file name to be saved at: " & vbLf & _
ThisDoc.Path & "\", "iLogic", sDefaultName)

'catch cancel
If sNewName = "" Then
	Exit Sub
End If

Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

'count the number of occurences in the assembly
oOcc_PreCount = oAsmCompDef.Occurrences.Count

oCmdM = ThisApplication.CommandManager

'place new occurences
'code from Luke Davenport example, found at:
'https://www.cadlinecommunity.co.uk/hc/en-us/articles/202291732-Autodesk-Inventor-2015-Place-Component-With-iLogic
' Inform the command manager which file you are about to place using iLogic
oCmdM.PostPrivateEvent(PrivateEventTypeEnum.kFileNameEvent, sFile1)
' Run 'Place' - rule will wait until you have finished placing components....
oCmdM.ControlDefinitions.Item("AssemblyPlaceComponentCmd").Execute2(True)

'count the number of occurences in the assembly again
oOcc_Count = oAsmCompDef.Occurrences.Count

'get number of new occurences
oDelta_Count = oOcc_Count - oOcc_PreCount

'replace new occurences
For i = 1 To oDelta_Count
	
	Dim oOcc As Inventor.ComponentOccurrence
	oOcc = oAsmCompDef.Occurrences.Item(oOcc_PreCount+i)
	
	'add path 
	sFile2 = ThisDoc.Path & "\" & sNewName & sExtention
	
	Try
	'save off a copy
	oOcc.Definition.Document.SaveAs(sFile2, True)
	Catch
	'catch error
	'example when file already exists
	End Try
		
	'replace occurence with the copied file
	Component.Replace(oOcc.Name, sFile2, False) 

Next


0 Likes
Message 13 of 14

MechMachineMan
Advisor
Advisor

I might misunderstand your requirements but here is how I would approach it:

 

1) Receive order to create a "tweaked design"

2) Create a folder for this new tweaked design

3) Create a project file for this new tweaked design.

     - In this library, define the past projects whose parts you wish to use and tweak as Library Locations

4) Save a copy of the old top level assembly which you wish to reuse to this new project location.

5) In this new project, every old part is now read as a library part which prevents you from changing it. To change a PART of a SUB-ASSEMBLY, you must FIRST replace the Sub-Assembly With a New version of the sub-assembly. Then from there you can change the PART.

6) Do the change-over of parts by using the "Save and Replace" functionality.

7) Profit.

 

Good luck!

 


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 14 of 14

Curtis_Waguespack
Consultant
Consultant

@Welbilt_Designer_3

 

Here is a quick video of the code example I posted yesterday in action, in case it helps you or someone else in the future.

 

In the video I added a form with a small set of files listed. I might use this in the future as well, and if I do, I'll read in contents of certain "library" folders to populate the list(s). And I'll automatically name the new components using the Job number from the assembly's iProperties, but I don't have time at the moment to take this that far.

 

Note: Here's a link to the other thread discussing this:

https://forums.autodesk.com/t5/inventor-customization/prompted-name-change-when-placing-parts-in-an-...

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

0 Likes