.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The Content Builder and the API

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bobbyg
444 Views, 4 Replies

The Content Builder and the API

I build MEP models with the Content Builder. Pretty much every model that I build will have the same parameters: box length/width/height, inlet length/width/height, outlet length/width/height, etc. I would like to know if there's any way to programmatically add those parameters to a model. Thanks!

4 REPLIES 4
Message 2 of 5
Keith.Brown
in reply to: bobbyg

There is no API for the Content Builder. What you can do is start a 'blank' part and create the parameters and then save the part in your favorite location. Next time open the part and use save as to place the part in the appropriate location. Another option might be to try and manipulate the XML file programmatically. Not sure how this will effect the dwg file though. Good luck!
Message 3 of 5
bobbyg
in reply to: bobbyg

I appreciate your reply. The idea for saving a part template is a good one--I'll definitely start doing that. I however think that programmatically manipulating the XML is out of the question. Each parameter has an ID and an index, and I don't want to start adding random values. 

 

I have one more question: I've seen that in the 'part size name' parameter you can use VB or some scripting language to manipulate the values. I use left and right hand values for my models; in order to do this, I have a hand flag and a usually large equation that moves certain profiles around based on the hand flag. It would be MUCH easier to be able to have a script that moves a dimension value based on the hand flag so I don't have to figure the equations out myself. Do you know of a way to do this? Thanks again.

Message 4 of 5
Keith.Brown
in reply to: bobbyg

You can use vbscript in content builder but here are very limited commands that you can use.  They are the condiditonal statements, (greater than, less than, equal, etc, and then If-then-else statements.  This will allow you to drive your geometry I believe.  If Hand = 1 then parameter = x else parameter = y.  You can also validate and restrict certain sizes.  For example, using a part size validation test and setting its formula equal to Total Length > Length A + Length B.  If this statement becomes false when inputing values into Length A and Length B, it will not allow the value to be entered.  This can make sure that the user does not 'break' your part.  I believe that in order to have access to these types of functions you will have to activate the advance mode of content builder which is done by typing pfadvanced at the command line.

 

Good Luck!

Message 5 of 5
bobbyg
in reply to: Keith.Brown

That works perfectly! Thank you very much for all of your help.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost