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

Text Parameters to match dimension style

Text Parameters to match dimension style

Hello,

 

I would like to see the dimensional pararmeters inserted in to a text field match the dimension style. 

 

PARAMETER-IN-TEXT.jpg

 

 

I would like this to show in fractions...

 

PARAMETER-IN-TEXT2.jpg

 

This would be nice.   Maybe the text could also match a dimension style that has the tolerance and style etc.

 

Thanks,

Ivon

 

25 Comments
jletcher
Advisor

It can if you go back to the model fx and set it for fractions..

leblanc2024
Advocate

Hello jletcher,

 

I tried changinf the value to a fraction.  The fraction is only displayed in the fx but the value is then converted to the nominal value (decimal).

 

Parameters.jpg

 

Thanks for the suggestion.  Unfortunately it didn't work.  Is there another setting I am missing?

 

Thanks again,

Ivon

 

jletcher
Advisor

Do you do this often? There is a better way then using text. I rather show you that if you do it often..

leblanc2024
Advocate

Hello jletcher,

 

This is something common here.  Every bent tube or bar generates a sweep length.  We use this as a material quantiy as wel as the measured cut length for our fabrication department.

 

This is a nice to have but not 100% neccessary request.

 

Thanks

Ivon

jletcher
Advisor

So you use a sweep to make the part and not bend command. I prefer bend command. 

 

I can help you with this and make it much much easier for you..

 

 Question to make sure I get it set up right for you.

 

 How did you get the length of the sweep?

 

 

 

 

leblanc2024
Advocate

Hello jletcher,

 

We currently use an iLogic rule to generate the sweep length of a tube or bar. (here is the code)

 

'Set a reference to the active part document
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument

Dim oDef As PartComponentDefinition
oDef = oDoc.ComponentDefinition

Dim opath As Path
opath = oDef.Features.SweepFeatures.Item("Sweep1").Path

Dim TotalLength As Double
TotalLength = 0

Dim oCurve As Object
Dim i As Integer

For i = 1 To opath.Count
oCurve = opath.Item(i).Curve

Dim oCurveEval As CurveEvaluator
oCurveEval = oCurve.Evaluator

Dim MinParam As Double
Dim MaxParam As Double
Dim length As Double

Call oCurveEval.GetParamExtents(MinParam, MaxParam)
Call oCurveEval.GetLengthAtParam(MinParam, MaxParam, length)

TotalLength = TotalLength + length
Next i

Dim oparams As Parameters
Dim oparam As Parameter
oparams = oDoc.ComponentDefinition.Parameters
Dim exists As Boolean
exists = False

'Find out if parameter exists
For Each oparam In oparams
If oparam.Name = "Sweeplength" Then exists = True
Next oparam

'Change the value if the parameter exists otherwise add the parameter
If exists Then
oparams.Item("Sweeplength").Value = TotalLength
Else
oparams.UserParameters.AddByValue( "Sweeplength", TotalLength, 11266)
End If
oDoc.Update

 

Regards,

Ivon

 

LT.Rusty
Advisor

This is actually not particularly difficult to do already.

 

Step 1:

 

Find your parameter, check the boxes for KEY and EXPORT.  Click on the little triangle button next to the parameter equation, and click on CUSTOM PROPERTY FORMAT.  Change it to fraction and set the precision to whatever you want. 

 

 

Step 2:

 

Create your text in the drawing, but instead of using model parameters / user parameters, go to the set of boxes above that.  Set TYPE to CUSTOM PROPERTIES - MODEL, pick the property you want to use, and then insert it.  Click OK, and boom - fractions.

 

 

Step 3:

 

???????

 

Step 4:

 

PROFIT!!!!!

 

 

 

 

Capture.JPG

 

Capture.JPG

 

leblanc2024
Advocate

Hello LT.Rusty,

 

THis worked... but is there a way to automate the custom property setting via the iLogic rule?

 

Thanks,

Ivon

jletcher
Advisor

Seeing LT is helping now I guess I will back off......  good luck Smiley Happy

LT.Rusty
Advisor

Plenty of room on the field, Jim, especially when it comes to iLogic.  I'll gladly let someone else handle that stuff whenever possible.  🙂

 

 

ileblanc - I'm not the right person when it comes to iLogic.  I can design and model the heck out of things, but I have only the most basic and marginal level of ability when it comes to iLogic.  I'm fairly certain there's a way to set the custom properties via iLogic, but don't know what it is.

jletcher
Advisor

Just add this below End If and before oDoc.Udate

 

 Uncheck the export option in the fx..

 

 

iProperties.Value("Custom", "Sweeplength") = RoundToFraction(Sweeplength, 1/32, RoundingMethod.Round)

 

jletcher
Advisor

One more thing to get the parameter in your text do it this way..

 

Put.JPG

 

Result

 

result.JPG

leblanc2024
Advocate

Hello jletcher,

 

I tried the method you posted.  The result I get is (CUT LENGTH = 0). 

 

This is what I added to the iLogic rule.

 

End If
    
    iProperties.Value("Custom", "Sweeplength") = RoundToFraction(Sweeplength, 1/32, RoundingMethod.Round)   
    
    oDoc.Update

Pleas advise.

 

Thanks,

Ivon

jletcher
Advisor

Did you uncheck the export?

 

 Did you run the rule after insert?

 

 Can you post screen shot of you adding it to text dialog...

leblanc2024
Advocate

Hello jletcher,

 

Here are the screen shots you requested.

 

 

PARAMETER-IN-TEXT3.jpg

 

PARAMETER-IN-TEXT4.jpg

 

I did run the rule after the change. I also tried changing the model so that the value changed.

 

I hope this helps.

 

Thanks,

Ivon

jletcher
Advisor

What version you on?

 

So when you hit ok on text it shows CUT LENGTH = 0 on sheet?

leblanc2024
Advocate

I am using AutoDesk Invenetor Ultimate 2014.

 

Yes it does show CUT LENGTH = 0 on sheet.

 

Regards,

Ivon

jletcher
Advisor

Strange it should work.

 

 I don't have 2014 here at this clients office can you email me the part so I can check it out after I leave here and go where I do have 2014?

 

Everything looks right and should work as mine..

 

 Can you screen shot the custom iproperties in the model for me and post here..

leblanc2024
Advocate

Hello jletcher,

 

I'm not sure how to upload a file to you.

 

Here is the screen shot you requested.

 

PARAMETER-IN-TEXT5.jpg

 

Regards,

Ivon

jletcher
Advisor

That is strange for sure.

 

 I sent you a private message with my email..

 

  I will take a look to see what the issue is..

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

Submit Idea  

Autodesk Design & Make Report