Change size - Content Center

Change size - Content Center

CCarreiras
Mentor Mentor
3,262 Views
24 Replies
Message 1 of 25

Change size - Content Center

CCarreiras
Mentor
Mentor

Hi!

 

I use this vb routine to change Content Center sizes within a family of elements.

In previous versions it work very well, but now it's working very erratic.

 

Any sugestions to solve this, or tips for a better method to do this operation?

 

Conditions:

Change the size of a Standard Content Center part (no need to change to a different family, only the size)

The Content center is in a custom folder inside the project folder

The size is changed based in the change of a parameter inside main asssembly

The parts are in the first level of the main assembly, not in a sub-aasembly.

 

Test attached.

Also check the video to resume the issue.

 

Thanks a lot for your help.

I'm not a power programer, and now i'm lost... i used this method in a few iLogic assemblys, and now i can't make them work well.

 

 

CCarreiras

EESignature

0 Likes
3,263 Views
24 Replies
Replies (24)
Message 2 of 25

Anonymous
Not applicable
Hi..looks odd...can u please copy paste "reply"...ilogic codes here...since I don't have Inventor 2016...let me check code first..
0 Likes
Message 3 of 25

CCarreiras
Mentor
Mentor

 

Hi Baku!

 

The code and process is so simple!! That's why i like this process.

But it start to fail in inv2016.

I guess is the vb macro. it was build for 2012version i guess...

 

Thanks for your help.

 

SyntaxEditor Code Snippet

AddVbFile "ContentCenterReplace.iLogicVb"
Dim replacer As New ContentCenterReplace(ThisDoc.Document, ThisApplication, "en-US")
Dim familyName As String ="Fasteners:Bolts:Hex Head:ISO 4017"
Dim familyName_NUT As String ="Fasteners:Nuts:Hex:ISO 4032"
'123
Select Case HOLE

Case "10" 

    replacer.Replace("ISO_4017:1", familyName, "ISO 4017 - M10 x 20")
    replacer.Replace("ISO_4032:1", familyName_NUT, "ISO 4032 - M10")

Case "20" 

    replacer.Replace("ISO_4017:1", familyName, "ISO 4017 - M20 x 40")
    replacer.Replace("ISO_4032:1", familyName_NUT, "ISO 4032 - M20")    

Case "30" 

    replacer.Replace("ISO_4017:1", familyName, "ISO 4017 - M30 x 60")
    replacer.Replace("ISO_4032:1", familyName_NUT, "ISO 4032 - M30")    
    
End Select


iLogicVb.UpdateWhenDone = True

 

 

 

CCarreiras

EESignature

0 Likes
Message 4 of 25

Vladimir.Ananyev
Alumni
Alumni

Hi CarlosC,
the first line in your rule includes the additional VB code from the external file "ContentCenterReplace.iLogicVb".  Could you please attach it as well? 
Thanks


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 25

CCarreiras
Mentor
Mentor

Hi Vladmir!

 

the addicional vb code is in the zip file within the files with the name "Contentcenter replace.ilogicvb"..

The zipfile contains all the files needed to reproduce the issue described in the video.

 

Thanks!

CCarreiras

EESignature

0 Likes
Message 6 of 25

Vladimir.Ananyev
Alumni
Alumni

Now I see, sorry.

thanks


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 7 of 25

Vladimir.Ananyev
Alumni
Alumni

Hi Carlos,

I tested your rules on my side.  I use Inventor Pro 2016, SP1 Update 1,  Build 210, Date: 11/20/2015.

Your rules work great, no any error messages.  See my screencast.

  1. What is your Inventor version?
  2. Is it possible for you to transform your rules into VB project to debug the code in the Visual Studio IDE?

Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 8 of 25

CCarreiras
Mentor
Mentor

Hi Vladimir!

 

I discovered the issue where about a windows update that was messing with the vb rule.

 

I uninstalled the windows update, and the rule worked again well, like in your screencast.

 

Now i upgraded for inventor 2017, and the problem appeared again, but now i dont have any windows update to uninstall. i dont know what to do.

Could you test this now in inventor 2017?

 

I'm using windows 8.1, but i also tsted in windows 10, and the issue persists.

Thanks.

 

CCarreiras

EESignature

0 Likes
Message 9 of 25

adam.nagy
Autodesk Support
Autodesk Support

Hi Carlos,

 

Would you be able to migrate your code to a Visual Studio application and then debug into the code to see why it fails exactly?

That would be the best.

 

Cheers,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 10 of 25

CCarreiras
Mentor
Mentor

Hi @adam.nagy,

 

I'm tired of searching which "windows update" keep making this to fail, can you help on this?

 

I'm not a power programmer, i tried to change some things, but now i see, this is beyond my vb knowledge.

 

I think this macro was written a long time ago, and something needs to be updated, but i don't know how.

 

Can you help?

 

Thanks in advance.

CCarreiras

EESignature

0 Likes
Message 11 of 25

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

It seems that when using your code sooner or later the Content Center or its API access gets messed up.

Not sure why.

 

I added two message boxes to the "ContentCenterReplace.iLogicVb" file (attached) to get more info on what happens after CreateMember call and when a node is not found.

 

Turns out that it's the "Nuts" or "Bolts" node under "Fasteners" which becomes inaccessible. 😕

Could you confirm that you run into the same problem?

 

Cheers, 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 12 of 25

adam.nagy
Autodesk Support
Autodesk Support

here is the file...



Adam Nagy
Autodesk Platform Services
0 Likes
Message 13 of 25

CCarreiras
Mentor
Mentor

Hi!

 

Thank you for your help.

 

Yes, that's it. when i run the rule, I got a message saying that the it can't find a bolt, or a a nut, but if i run again the rule a couple of times, sooner or later, it finds it at the end.

 

This worked well in windows 7 and 8.1, but in the latest windows updates (win 8.1 and win10) this vb start to have this issue. when i delete the updates, it start to work well again, but later comes new updates, so, the issue comes back.

 

I liked a lot this process, but i have to change it for a different Replace process to end the issues.

 

if you find how to solve it, please let me know. Thanks a lot.

 

CCarreiras

EESignature

0 Likes
Message 14 of 25

adam.nagy
Autodesk Support
Autodesk Support

I logged this issue in our system to be investigated.



Adam Nagy
Autodesk Platform Services
0 Likes
Message 15 of 25

tmuel
Advocate
Advocate
Hi Adam, I am bumping into this same issue. Same contentCenterReplace.vb file developed by Mike Deck several years ago. My company is using inventor 2016. Certain parts replace as expected, others do not. Error that the cc part number can't be found. I thought I had found the issue when I found inconsistency in the database FILENAME field. After fixing that, the issue remains. The most troublesome things is it is not always consistent.

Any updates on this issue would be much appreciated.

Can you please share the case number so I can dig deeper?

Thank you!
0 Likes
Message 16 of 25

CCarreiras
Mentor
Mentor

Hi!

 

I used that vb to change content center in previous assemblys.

 

Since windows 10, microsoft released some updates that mess with tha Visual basic, and this rule start to work randomly bad.

At first i unistalled that updates, but i get tired of that and simply changed the way i change content center components in iLogic assemblys.

 

I advise you to do the same... change the process...

 

 

CCarreiras

EESignature

0 Likes
Message 17 of 25

tmuel
Advocate
Advocate

That's unfortunate. I can't have this randomly not working based on windows updates.

 

Would you please share with me your process for replacing Content Center components using iLogic now? 

 

 

0 Likes
Message 18 of 25

tmueller6RR3D
Participant
Participant

Any updates on this? I need to have the ability to replace from Content Center using iLogic - or VB.net reliably.

 

Thanks,

0 Likes
Message 19 of 25

adam.nagy
Autodesk Support
Autodesk Support

Hi,

 

Not sorted yet, unfortunately 😞

For your reference, the id of the issue is #152258

 

Cheers,

 



Adam Nagy
Autodesk Platform Services
0 Likes
Message 20 of 25

Anonymous
Not applicable
0 Likes