Inventor Customization

Reply
Contributor
ddavis
Posts: 20
Registered: ‎04-20-2011
Message 1 of 4 (302 Views)
Accepted Solution

iLogic and Title Blocks

302 Views, 3 Replies
11-19-2012 08:46 AM

I have been working on a rule for use with our title block that has been mostly successful. The last hurdle is the precision of the DIM values. The will not show the trailing zeros no matter what I do. I have tried changing the precision of the values, but still I have no luck getting them to show 3 decimal places including the trailing zeros. Looking at the picture below I would like the DIM. (FINISHED) field to read 5.000x5.000x12.500. Is there some code that I can use to force this output? I would also like to force the DIM. (INITIAL) value to use 3 decimal places.

 

Capture.PNG

 

I have attached my code as well. Please note that I'm driving by brail so to speak and have no idea what I'm doing, .

 

If anyone could shed some light on this I would really appreciate it.

 

Darek

ADN Support Specialist
Vladimir.Ananyev
Posts: 458
Registered: ‎08-14-2012
Message 2 of 4 (271 Views)

Re: iLogic and Title Blocks

11-26-2012 05:26 AM in reply to: ddavis

I hope function FormatNumber() can be useful for you.

 

I created a simple part model with three model dimensions bL, bW, bH having integer values:

2.PNG

 

Then I’ve created an iLogic rule that updates custom text iProperty "DIM (Finished)":

 

Dim St As String = _

               FormatNumber(CDbl(bL), 3) & "x" & _

               FormatNumber(CDbl(bW), 3) & "x" & _

               FormatNumber(CDbl(bH), 3)

iProperties.Value("Custom", "DIM (Finished)") = St

 

As a result I have string with 3 decimal digits for every dimension:

1.PNG

 

This custom property value can be put into any field in the TitleBlock.


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

Contributor
ddavis
Posts: 20
Registered: ‎04-20-2011
Message 3 of 4 (261 Views)

Re: iLogic and Title Blocks

11-26-2012 09:29 AM in reply to: Vladimir.Ananyev

Vladimir,

 

Thank you very much for your help with this. After incorporating this into my iLogic program, it opened my eyes to many other opportunities I had to improve my code. This rule was quickly becoming a "Moving Forward" only rule, but now I have managed to make it work for most of our previous drawings.

 

Thank you again for your help.

 

Darek

ADN Support Specialist
Vladimir.Ananyev
Posts: 458
Registered: ‎08-14-2012
Message 4 of 4 (243 Views)

Re: iLogic and Title Blocks

11-26-2012 10:50 PM in reply to: ddavis

Good luck with iLogic rules!


Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube