Parameters Update in order

Parameters Update in order

Anonymous
Not applicable
627 Views
3 Replies
Message 1 of 4

Parameters Update in order

Anonymous
Not applicable
Hi All,

I need some help... I have written a VBA that iterates thru the Top level assembly as well as all sub components and sub assembly (as I have said often). I can get my code to run and perform all of my parameter updates as i need. The problem I am having is my particular parts are adaptive (13 pieces total) If I manually go thru all of the part changing the parameters individually for each object then hit update everything works great. If I use my VBA application, then use global update. I have a couple of pieces fail. I think it's because the VBA is updating everything at once (or close to it). Is there a way to update the components as i'm looping thru the occurrences? All I seem to be able to do is an assembly document update which does not work. Any help would be greatly appreciated...

Thanks,
Bill
0 Likes
628 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Bill: When your VBA changes the parameters in each individual part file, do you perform an update using the Update method of the Document Object and then save the document? Is it only the adaptive parts that are failing? You probably have a good reason, but why are you changing parameters in individual part files from VBA. It might be easier to link all your parameters back to a Master IPT file. Have your VBA update this file and save it and then just update the Assembly Document (let Inventor do the work). -- Robert A. Williams http://www.leacar.com > I need some help... I have written a VBA that iterates thru the Top level assembly as well as all sub components and sub assembly (as I have said often). I can get my code to run and perform all of my parameter updates as i need. The problem I am having is my particular parts are adaptive (13 pieces total) If I manually go thru all of the part changing the parameters individually for each object then hit update everything works great. If I use my VBA application, then use global update. I have a couple of pieces fail. I think it's because the VBA is updating everything at once (or close to it). Is there a way to update the components as i'm looping thru the occurrences? All I seem to be able to do is an assembly document update which does not work. Any help would be greatly appreciated... > > Thanks, > Bill
0 Likes
Message 3 of 4

Anonymous
Not applicable
Robert,

Sorry for the delay in this reply... I had a deadline I needed to meet. Anyway,

1. After my code runs through it's entire process, just before it exits the code I have the assembly update object. There is a combination of ipt's and iam it needs to update. So the answer is yes and no. I have not figured out a way to have it update the ipt's when they are modified, then update the iam's when they are modified. I do not have it save after my code runs either.

2. Yes it is only the adaptive parts failing.

3. I would have exported the parameters I needed to one "fake" ipt and just wrote my code to control the parameters of the "fake" ipt. but I also want to gain access to the properties to change material as well as modify the parameters. As far as I know, I don't believe you can export properties the same way you can the parameters. So I figured since I had to write code to iterate through all of the iam's as well as the Ipt's. to gain access to their properties, I figure I might as well modified everything for one part, one part at a time.

Thanks for you reply
Bill
0 Likes
Message 4 of 4

Anonymous
Not applicable
Hi Bill: If you are modifying parameters, you should have the PartDocument Object. Before moving on, you should run the update method on the Part Document (e.g. PartDocument.Update) and save it (e.g. PartDocument.Save). Otherwise, the changes may not show up in the assembly. This lack of updates *may* be causing the adaptive part problems. Hard to say from here. rw -- Robert A. Williams http://www.leacar.com > Robert, > > Sorry for the delay in this reply... I had a deadline I needed to meet. Anyway, > > 1. After my code runs through it's entire process, just before it exits the code I have the assembly update object. There is a combination of ipt's and iam it needs to update. So the answer is yes and no. I have not figured out a way to have it update the ipt's when they are modified, then update the iam's when they are modified. I do not have it save after my code runs either. > > 2. Yes it is only the adaptive parts failing. > > 3. I would have exported the parameters I needed to one "fake" ipt and just wrote my code to control the parameters of the "fake" ipt. but I also want to gain access to the properties to change material as well as modify the parameters. As far as I know, I don't believe you can export properties the same way you can the parameters. So I figured since I had to write code to iterate through all of the iam's as well as the Ipt's. to gain access to their properties, I figure I might as well modified everything for one part, one part at a time. > > Thanks for you reply > Bill
0 Likes