Forms issue from copied files

Forms issue from copied files

llorden4
Collaborator Collaborator
213 Views
4 Replies
Message 1 of 5

Forms issue from copied files

llorden4
Collaborator
Collaborator

I have created some template files in which I use Forms to assist the drafter with creating repetitive parts and assemblies.  Occasionally, I will need a part that is very similar to one I've already completed with some slight variations and rather than re-create the entire form from scratch, I'll simply take the current file and perform a "Save-As" to a new filename, giving a new name to the part file and then also renaming the Form within.

 

The problem I'm running into is that when both the original file and copied/renamed file are open, Inventor is treating these Forms as the same form.  If one is open, the other will not open; so I'm not able to work on both files side-by-side to visually ensure the data matches where needed.  They do correctly modify the correct  desired part file.

 

I suspect the Form is given an internal hash code for addressing and because I copied and renamed it, the hash code was not re-issued.  Is my only option to delete the Form and re-create it again from scratch to get it to behave separately or is there a trick or hack I can apply to achieve this?

Autodesk Inventor Certified Professional
0 Likes
Accepted solutions (1)
214 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Hi @llorden4.  You seem to encounter interesting and challenging programming related situations on a somewhat regular basis.  😏  In all my years using Inventor and interacting with it by code, I don't think I've ever had two identical part files visibly open on my screen at the same time and tried to show identical internal iLogic forms in both of them at the same time.  I guess statistically, it had to happen at some point.  😄  I am not 100% sure those types of forms have a Property like the Document.InternalName, but they should have at least had different 'handles' assigned to them when launched.  I guess I should ask the most basic question that I can think of first, then go from there.  Are both forms 'designed as' NonModal, or are both being 'shown' as NonModal?  If either were designed as Modal, or shown as Modal, that might cause them to not both show at the same time.

Beyond that, we do have a certain amount of 'experimental' access to some of the form's 'specifications', starting from the document level Attributes (see Links below), but I wouldn't recommend relying on any of that on a regular basis.

https://forums.autodesk.com/t5/inventor-programming-forum/delete-forms-with-rule/m-p/12560701/highli... 

https://forums.autodesk.com/t5/inventor-programming-forum/remove-ilogicform-by-ilogic-rules/m-p/1256... 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 5

llorden4
Collaborator
Collaborator

I do have the pleasure of pushing boundaries in what I do everyday, to be certain.  To add a bit more clarity to my post, these are not identical part files, they do "start" that way since I am making a copy, but that copied file is a modified part file that creates a similar but different part.  For example, the original part contains the Form and supporting iLogic to create a tube of a specific shape, size, taper, rise, length, etc.  I might also need a backing bar created for welded support in the assembly.  Since that backing bar is designed to slip inside that afore mentioned tube, it's simple enough to simply take that same programming and adjust the size and cutting position, and add to the current iLogic coding to make that all happen.

 

Since their inputs for development are basically identical, it's very beneficial to have both forms up at once to ensure the data matches for that shape, size, taper, rise, etc.  The form itself is a static (and I believe nonModal) I preconfigure manually within each part file.  Here's a snippet.

snipsnip
 
I've simply been renaming the head label and wondering if there's another method to make these unique between the two files and then adding/removing a few other Parameters within for final adjustments.
As you can see, these forms take a bit of work to develop and why I'm trying to find shortcuts.
Autodesk Inventor Certified Professional
0 Likes
Message 4 of 5

WCrihfield
Mentor
Mentor

I do not know of (and have not tried) a shortcut way to rename or customize the contents of an internal iLogic form entirely by code yet.  In the other forum discussions I provided Links for in my first reply, I attached a code example that shows how I managed to find a document level attribute set for an internal iLogic Form, convert its Byte Array value into a String, then create a new XML document and load the contents of that String into it, then navigate some of the contents of that XML document code to find the name of the Form, just to see if it was the one I was looking for, so I could delete just that one internal iLogic Form, without deleting them all.  Then it continues to find that same form's name in the specs of the iLogic 'Forms' tab itself, to get rid of the 'button' for launching that Form.  That was a rather long and complex process that took quite a while of snooping and trial & error testing to figure out how to do.  I know that those sorts of things can be accessed by code, because I have seen some of the resources being used for them, and know that all that stuff works by code somehow anyways, whether I fully understand it or not.  But I have simply not dug that deep into it yet.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 5 of 5

llorden4
Collaborator
Collaborator
Accepted solution

I was able to find a very simple solution, once I stopped trying to find a secret passage to success.

I simply copied the final form and pasted it back into the same part file, the copy now having a suffix of "1" added to the end automatically by Inventor.

Then deleted the original copied Form, renamed that new copied form by removing that "1" suffix, and now it has it's own unique address and I didn't have to rebuild the entire Form.

 

Things you only think of once you go public.  Thanks @WCrihfield for your review & feedback.

Autodesk Inventor Certified Professional