Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Ilogic max character check

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
-ianf-
1806 Views, 5 Replies

Ilogic max character check

We use iproperties to describe our parts and have a 40 character limit. Is there any way ilogic could be used to check and possibly warn if an iprop field exceeds 40 characters?

 

Thanks

Ian Farmery
Inventor & Vault 2023

Dell 7550 Xeon E-2276M, 2.80Ghz 64GB RAM
Nvidia Quadro RTX 4000
5 REPLIES 5
Message 2 of 6
MegaJerk
in reply to: -ianf-

Which iProperty field are you using? Do you ever change the field that you fill out or is it consistent across all parts? 



If my solution worked or helped you out, please don't forget to hit the kudos button 🙂
iLogicCode Injector: goo.gl/uTT1IB

GitHub
Message 3 of 6
-ianf-
in reply to: MegaJerk

We populate many iprop fields but it is the "TITLE" and the "DESCRIPTION" fields that sometimes breach the 40 character limit. Each part has a different title/description.

 

The "TITLE" field is populated with the same characters as the "DESCRIPTION" field. We currently use a line in the rule to

control this;

 

iProperties.Value("summary", "Title") = iProperties.Value("Project", "Description")

 

Ian Farmery
Inventor & Vault 2023

Dell 7550 Xeon E-2276M, 2.80Ghz 64GB RAM
Nvidia Quadro RTX 4000
Message 4 of 6
Curtis_Waguespack
in reply to: -ianf-

Hi -ianf-,

 

Here is one method:

 

TitleInput:
Dim MyTitle As String
MyTitle = InputBox("Enter Title" & vblf & "( 40 character limit )", "iLogic", _
 iProperties.Value("Summary", "Title"))
iProperties.Value("Summary", "Title") = MyTitle
currentLength = Len(MyTitle)
If currentLength > 40 Then
MessageBox.Show("Please limit the input to 40 characters or less." & vblf & _
"Current Input Length = " & currentLength, "iLogic ")
Goto TitleInput
Else
End If

 I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 5 of 6
-ianf-
in reply to: Curtis_Waguespack

Thanks for that,

great liitle code which will definatley have a use.   I am trying to build on some of the commands you have used but I am struggling.

 

Our iprop descriptions/titles are already populated from the parameters using a small code. Basically as the size of the part changes so do the descriptions.  We don't require a description input box.

What I would like to happen is that an ilogic code checks the already inputted description for the character length and bring up a warning if the 40 limit is breached.

 

For example we have several sheet metal parts that can have many folds. Each fold size ends up in the part descriptions so there is the potential (on complicated pressed parts) to exceed 40 characters.

 

Thanks

Ian Farmery
Inventor & Vault 2023

Dell 7550 Xeon E-2276M, 2.80Ghz 64GB RAM
Nvidia Quadro RTX 4000
Message 6 of 6
Curtis_Waguespack
in reply to: -ianf-

Hi -ianf-,

 

Something like this will simply check the iProperty and then alert the user that it exceeds the limit.

I would set this to trigger on the Open and Save events, in order to catch the 40+ striings when a file is acessed or updated.

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

Dim MyTitle As String
MyTitle = iProperties.Value("Summary", "Title")
currentLength = Len(MyTitle)
If currentLength > 40 Then
MessageBox.Show("The Title iProperty currently exceeds the 40 character limit." & vblf & _
MyTitle & " = " & currentLength & " characters" , "iLogic ")
Else
End If

 

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

Post to forums  

Autodesk Design & Make Report