ilogic add model parameter to dimension of a drawing

ilogic add model parameter to dimension of a drawing

r_pruellage
Contributor Contributor
711 Views
8 Replies
Message 1 of 9

ilogic add model parameter to dimension of a drawing

r_pruellage
Contributor
Contributor

Hello everyone,  i´ve been looking into the possibilithy of automating drawings with ilogic, so far so good.

My question is, can i add parameters in the dimension in my drawing

example 15x125(=1875) >> 15 and 125 are parameters of the model

and the 1875 is a dimension in the drawing, witch i would like to expand

or/and 25xØ18 >> 25 is a parameter of the model and the Ø18 is a dimension in the drawing, witch i would like to expand.

The update should always occur when the rule (not an external rule) is executed.

A dimesnion should not have to be selected.

Thanks in advance.

0 Likes
712 Views
8 Replies
Replies (8)
Message 2 of 9

blandb
Mentor
Mentor

I know you can manually add parameters to the drawing, so you should probably be able to programmatically do it:

 

blandb_0-1718115696902.png

 

Autodesk Certified Professional
0 Likes
Message 3 of 9

A.Acheson
Mentor
Mentor

Hi @r_pruellage 

This question would be best suited on the ilogic forum and not here on the inventor forum. 

To clarify what your asking, you want a parameter value to be put in the dimension rather than the true dimesion being sourced from the model? 

 

For this sort of multi size drawing my preference would be to create a table and to reference the dimensions via letters and the value changes in the table. Or alternatively you could use model states and referenced the true dimensions, indicate which member is being used and then supply the modelststes table for other dimensions. Actually no ilogic used at all. 

 

Some issues,

1. EDIT:  As pointed out by @blandb parameters can be added to dimension. To add parameter via ilogic code the term required is formatted text The parameter will get sourced from the views referenced model. 

2. How to identify with dimension to change. Other than knowing you want to change dimension index number 10 for example there will be no way to know what dim to target.  

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 4 of 9

r_pruellage
Contributor
Contributor

Hallo, were is the ilogic forum? 

I want the real dimension and add here parameters. The dimension is the true dimension with some added Parameter 

0 Likes
Message 5 of 9

Frederick_Law
Mentor
Mentor

Show a screenshot of how it look in drawing.

d32 2"

2" d32

 

Your files are 2024, I can't open them.

0 Likes
Message 6 of 9

r_pruellage
Contributor
Contributor

r_pruellage_0-1718127786993.png

22 is a parameter and 18 is a dimension of the hole

r_pruellage_1-1718127892468.png

4 is a parameter and 345 another parameter

1380 is a dimension

2070you can ignore.

0 Likes
Message 7 of 9

Frederick_Law
Mentor
Mentor

You should name those Parameters.  So iLogic can search for them.

 

For the first one, I believe it's holes count?  Hole notes can to the count.

Otherwise add a Parameter named "d18HoleCount" and use it in dimension: <d18HoleCount>x

 

For 4x345(=1380), you'll need 3 parameters: <Count1>x<Dist1>(=<Total1>).

And use equation in Total1: =Count1 x Dist1

 

Best to set them all as User Parameters.  You can use them in model parameter.

0 Likes
Message 8 of 9

r_pruellage
Contributor
Contributor

Hello, i will name the parameters. Thanks a lot.

I will use it for a drawing as a dimension added with parameters. 

The ilogic snipped for a linear dimension is clear/ i noch how to do that. How should it look? 

0 Likes
Message 9 of 9

A.Acheson
Mentor
Mentor

Dimensioning in the way you are describing is a lot of work manully and by code and you will end up with a not to scale drawing. If you need to do it the following lines are the end product to extract the formatted code of the dimension. 

From this vba sample here work through each dimension. Converted to ilogic and using this help page here for syntax of formatted text.

You can read the formattedtext to discover the link from the model parameter. Once you have the text used to created the dimension you can make modifications to it much the same way as the user manully does it. 

 

Syntax

DimensionText.FormattedText() As String

 

 

    ' Set a reference to the active drawing document
    Dim oDoc As DrawingDocument = ThisApplication.ActiveDocument

    ' Set a reference to the active sheet
    Dim oSheet As Sheet = oDoc.ActiveSheet

    ' Iterate over all dimensions in the drawing and
    ' center them if they are linear or angular.

    For Each oDrawingDim As DrawingDimension In oSheet.DrawingDimensions
        If TypeOf oDrawingDim Is LinearGeneralDimension Then
            Logger.Info(oDrawingDim.Text.FormattedText)
        End If
    Next

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes