Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ilogic Change Size of Custom Bolt

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
johnster100
765 Views, 4 Replies

ilogic Change Size of Custom Bolt

Hi,

I've used a bolt in my assembly from the content center. I saved this bolt as a custom part so it's in the same folder as my models. I've also added some work points to the bolt model to dimension in drawings.

 

I would like to use ilogic to change the bolt size (e.g from M10 to M20). I can do this manually by right clicking and selecting change size.

 

Is there a way to do this through ilogic? All I have seen so far is replacing the part from the content center which is not what i want to do as I lose my workpoints.

 

thanks,

John

4 REPLIES 4
Message 2 of 5
WCrihfield
in reply to: johnster100

Hi @johnster100.  I created a test scenario to test this situation on, but didn't save the bolt out and create work points on it.  Then I proceeded to attempt to change the size of the bolt through use of an iLogic rule.  Here is what I've got that has been working for me.

'name of your existing component (the one you want to change the size of)
Dim occName As String = "Heavy Hex Bolt - Inch 1/2-13 UNC - 1.25:2"
'Content Center category path down to the Family, but not including the Family
'each category name is seperated by colons (:)
Dim ccPath As String = "Fasteners:Bolts:Hex Head"
Dim familyName As String = "Heavy Hex Bolt - Inch"
'from the Table View, the value in the column who's internal name is 'Designation'
Dim designation As String = "1/2-13 UNC - 1.5" 
Components.AddContentCenterPart(occName, ccPath, familyName, designation)

You can see from the names and notes within, what type of bolt I had in my assembly.  To change its size, I simply changed something like the length ("1.5") to "1" (as long as it is available in the table), then run the rule, then it changes the size of that bolt, just as if I had right-clicked on it and chose the other length.  I hope this is what you were looking for.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5
johnster100
in reply to: WCrihfield

Hi,

thanks for the reply.

 

Unfortunately this does not work. It replaces the bolt in the assembly with a new one from the content center so I lose the work points I had added 😞

 

thanks,

John

Message 4 of 5
WCrihfield
in reply to: johnster100

OK.  I was just doing a little more testing and even though the PartComponentDefinition for the bolt I saved off locally does return True for its 'IsContentMember' property, there doesn't really appear to be any easy way to access any type of link or connection to the Content Center, that would allow you to 'change its size' at the part level, without 'replacing' it.  The next thing I would suggest, since you need a local copy and need to maintain work features placed on it, is to change its size by just changing its parameter values.

 

I believe that by default, when you invoke the 'Place from Content Center' to place a component into an assembly, it creates a new model file and stores it within the directory designated for Content Center stuff, which is like a Library, where it's all ReadOnly.  I don't recall if it reuses the same model file, if at a later date you insert the same configuration of a Content Center component into another assembly, but I'm thinking that it doesn't.  So modifying the model stored within the Content Center folder may not work either.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 5 of 5
johnster100
in reply to: WCrihfield

thanks for your help. It's one for the idea station I guess.

 

thanks again,

John

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report