Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

iLogic Named Geometry Appearance

btomosonEYBLL
Enthusiast

iLogic Named Geometry Appearance

btomosonEYBLL
Enthusiast
Enthusiast

I am trying to follow the steps from https://help.autodesk.com/view/INVNTOR/2021/ENU/?guid=GUID-80AD0392-0B8C-4A27-A9B3-7466D53999BF in the section "Use Assign Name to Identify Geometry for Constraints" to assign names to faces and then change the appearance of those faces with iLogic. I am able to create the named geometry and have set the option "Labels Visibility" to checked but I am unable to find a list of my named geometry in iLogic to interact with these faces.

 

The attached screenshot is from the help page but I am not able to see the lightbulbs or "show/hide labels" and i am also not able to see the named geometry in the models tab of the rule editor.

0 Likes
Reply
Accepted solutions (1)
2,285 Views
8 Replies
Replies (8)

WCrihfield
Mentor
Mentor

Which version & release year of Inventor are you using?

Can you see your iLogic browser?

If it is not showing up next to your Model Browser, you may need to either:

  • go to your Manage tab > iLogic panel > and click on "iLogic Browser".
  • or click the little plus sign (+) next to the Model tab and choose "iLogic".

Are you expanding the iLogic Tab (Dockable Window)?

Named Entities became available in Inventor 2019, I believe.

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

btomosonEYBLL
Enthusiast
Enthusiast

Which version & release year of Inventor are you using?

Inventor 2021.1.1

 

Can you see your iLogic browser?

Yes

 

If it is not showing up next to your Model Browser, you may need to either:

  • go to your Manage tab > iLogic panel > and click on "iLogic Browser".
  • or click the little plus sign (+) next to the Model tab and choose "iLogic".

It is showing

 

 

Are you expanding the iLogic Tab (Dockable Window)?

Attached is my iLogic dock showing what I can see for named geometry. It gives a "label visibility" option

 

 

Named Entities became available in Inventor 2019, I believe.

I can name entities, my problem is that I can not see these entities in the iLogic rule screen to be able to interact with them.

Attached is a picture from the tutorial showing the named items in the model browser on the rule screen.

Also attached is what I can see on my rule screen.

0 Likes

WCrihfield
Mentor
Mentor

I don't think they have incorporated that into the iLogic rule editor dialog yet.

You can get the named entities by

iLogicVb.Automation.GetNamedEntities

or similar (I'm about to leave my office for the day.)

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

J-Camper
Advisor
Advisor
Accepted solution

@btomosonEYBLL,

 

This is how you could access a list of the named geometry for API use:

'Access named entities
Dim myNamedEntities As NameValueMap = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).Entities
'Loop through each entity:
For i = 1 To myNamedEntities.Count
	MessageBox.Show(myNamedEntities.Name(i) & vbCrLf & CType(myNamedEntities.Value(myNamedEntities.Name(i)).Type, ObjectTypeEnum).ToString, "Test")
Next

As @WCrihfield  mentioned, you won't see this list in the iLogic browser when you are actively editing a rule, but they should be usable. 

 

If you know the name of the object you want you can pull it without getting other entities:

Dim entityToGrab As Object = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).FindEntity("Entity Name")

 

 

0 Likes

WCrihfield
Mentor
Mentor

Now that I'm back in my office, I see someone has already expanded on my suggestion of using the:

iLogicVb.Automation.GetNamedEntities

route to get the named entities you were after.

However, I would suggest a slightly different line to get a single item from the collection.

When you use the "FindEntity() function, it may cause an Exception (error), if it doesn't find what you're looking for, so therefore it usually would need to be enclosed within a Try...Catch...End Try statement, in order to avoid the possible Exception from abruptly stopping your rule somewhere in the middle.

Instead, I would suggest you use the "TryGetEntity()" function.

 

Dim oNE As Object = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).TryGetEntity("Entity's Name")

 

It will eliminate the need for the Try...Catch...End Try statement, because if it doesn't find the entity, it will simply return 'Nothing'.  Then all you need to do is check if the variable (the one who's value was to be the named entity) "IsNot Nothing".  If it passes this test you can use it as planned.  If it fails this test, you can use a MsgBox() or MessageBox.Show() to inform the user if you want and/or something like 'Return', or 'End Sub' to end the rule.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE" :thumbs_up:.

Also, when you have time, please review & vote for these 'Ideas' I'd like to get implemented.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here
  • Add kRevisionTag or kDrawingRevisionTag to ObjectTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

btomosonEYBLL
Enthusiast
Enthusiast

@WCrihfield  After I get the face as an object, how do I set the appearance of it?

0 Likes

J-Camper
Advisor
Advisor

There is actually an older forum post, from 2019, for this exact question: Forum Post 

WCrihfield
Mentor
Mentor

First of all, if you know what Type of object it is going to be you can create your variable as that type of object, instead of just Object.  That will make things easier.  If you are not sure which type of object you might be retrieving, you can check the .Type of the Object against some expected ObjectTypeEnum variances, after you've retrieved it.  You can retrieve the 'readable' name of the objects Type using this line:

Dim oObj As Object = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).TryGetEntity("Entity's Name")
If oObj IsNot Nothing Then
	oTypeName = [Enum].GetName(GetType(ObjectTypeEnum), oObj.Type)
End If

or you can use something like this to check if is one a few Types you're possibly expecting:

Dim oObj As Object = iLogicVb.Automation.GetNamedEntities(ThisDoc.Document).TryGetEntity("Entity's Name")
Dim oType As String
If oObj IsNot Nothing Then
	Select Case oObj.Type
		Case ObjectTypeEnum.kFaceObject
			oType = "Face"
		Case ObjectTypeEnum.kEdgeObject
			oType = "Edge"
		Case ObjectTypeEnum.kVertexObject
			oType = "Vertex"
	End Select
End If
If oType = "Face" Then
'so on and so forth

 If it's a face object, you can do something similar to what that other post has done.

Or you can access the documents StylesManager, then its available styles to choose one to apply.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)