iLogic - Accessing iProperties for different level of detail

iLogic - Accessing iProperties for different level of detail

troyD5S9A
Contributor Contributor
554 Views
5 Replies
Message 1 of 6

iLogic - Accessing iProperties for different level of detail

troyD5S9A
Contributor
Contributor

Hi Guys and Gals,

I am using the following rule to write the sheet names of a drawing to that of the part number of the main view of that sheet. It works perfectly until I introduce a drawing view of a LOD (level of detail) other than master.

Does anyone know how to access the iProperties that belong to that level of detail represented in the drawing view. Ideally I want it to work independent of the name of that detail so it will work for all models with different names for LOD or having only master LOD available.

 

I am returned with error: Object reference not set to an instance of an object.

Pretty much the information is not where it is searching.

 

Dim oSheets As Sheets

oSheets = ThisDoc.Document.sheets
Dim oSheet As Sheet
For Each oSheet In oSheets
oSheet.Activate
Dim oDrawingView As DrawingView
oDrawingView = oSheet.DrawingViews(1)
oModelName = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName

oDesc = iProperties.Value(oModelName, "Project", "Part Number")
oSheet.Name =  oDesc
Next 

 

 

0 Likes
555 Views
5 Replies
Replies (5)
Message 2 of 6

Sergio.D.Suárez
Mentor
Mentor

Hi, I'm not sure if this is what you need. Here I leave a modification to your rule that throws the name of the active LOD from your drawing view

 

Dim oDoc As DrawingDocument= ThisDoc.Document
Dim oSheets As Sheets= oDoc.Sheets
Dim oSheet As Sheet
Dim oView As DrawingView
Dim ActLOD As String 

For Each oSheet In oSheets
	On Error Resume Next
	oSheet.Activate
	oView = oSheet.DrawingViews(1)
	oModelName = oView.ReferencedDocumentDescriptor.ReferencedDocument.DisplayName

	ActLOD = oView.ActiveLevelOfDetailRepresentation
	MessageBox.Show(ActLOD)


	oDesc = iProperties.Value(oModelName, "Project", "Part Number")
	oSheet.Name =  oDesc
Next 

 I hope this helps with your problem. Regards


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

Message 3 of 6

troyD5S9A
Contributor
Contributor

Hi Sergio,

thank you, what I am trying to achieve is to pull the partnumber iProperty from the specific level of detail, your code works correctly by identifying the LOD in the drawing, but I need to somehow use that to search in the right place.

 

I am confused why it simply does not work as the part number and other iProperties are always consistent when the LOD is changed, but I guess the directions for fetching such information is now detoured through the new LOD.

0 Likes
Message 4 of 6

Sergio.D.Suárez
Mentor
Mentor

From what I understand the part number property is unique for a part or assembly file. There could not be a partnumber for each LOD. It is assumed that each PartNumber physically identifies a welded body, a part that can be stored correctly. If you want to place a PartNumber for each LOD you really need to create a new assembly for each LOD with its respective PartNumber, you should not create different LODs. This doesn't have to be a problem, maybe you think it would be a difficult task, but it isn't. Try to handle yourself with subassemblies to create sets of restricted parts correctly. You can then place them as a ghost in the BOM if you wish.
I hope this helps with your problem. Grettings!


Please accept as solution and give likes if applicable.

I am attaching my Upwork profile for specific queries.

Sergio Daniel Suarez
Mechanical Designer

| Upwork Profile | LinkedIn

0 Likes
Message 5 of 6

troyD5S9A
Contributor
Contributor

I am not trying to get different part numbers at all, I just want to read that iProperty but when I use LOD it prevents me accessing that info using the code I posted. I have iLogic setting up parameters and suppressing parts in this LOD so I must use it.

 

The code works perfectly on a part with only master LOD but as soon as I add a new LOD it faults. 

0 Likes
Message 6 of 6

troyD5S9A
Contributor
Contributor

 Does anyone else have any input on accessing the iProperties through iLogic code when a LOD is in place?

0 Likes