Hi,
There is an existing thread on this forum showing how to change the view rep in an assembly (using oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("Red").activate) - Thank you to Curtis Waguespack - however I am trying to achieve the same with iLogic in a part file (multi-solid). Is this possible please?
Many thanks
Solved! Go to Solution.
Solved by bobvdd. Go to Solution.
Following iLogic rule activates "View1" and should work both in a part or in an assembly.
Keep in mind that viewreps capture the part and body appearance in a multi-body part but not the face or feature appearance.
Dim odoc As Document Dim ocompdef As ComponentDefinition odoc = ThisApplication.ActiveDocument ocompdef = odoc.ComponentDefinition Try ocompdef.RepresentationsManager.DesignViewRepresentations.Item("View1").Activate Catch MessageBox.Show("This viewrep does not exist", "Error") End Try
Bob
It is really working for creating the view representations in the part. However, they are kind of not saved. I mean, when I click the view representtions from the browser, they are not consistent with what the respective ilogic created.
I need them to be consistent because down the road, I need these view representations to be used in the assemly level.
Please see the file attached here to.
I request help.
If you are talking about the two view represenations that make the sketch dimensions visible or invisible, then yes you have a good point.
We do not store the dimension visibility state in view representations. 😞
If you are interested to have identical drawing views but one with and the other without drawing views, my suggestion would be to create a separate solid body from your sketches first and then create two identical views, all without dimensions.
After that it is sufficient to retrieve the sketch dimensions on one of the views via the context menu.
See attached image on how the result would look like.
Cheers
Bob
I am not a Configurator360 expert but I don't think Configurator360 preserves viewreps when opening the part in the on-line viewer.
That is correct, C360 does not utilize the "active" design view representation (DVR) when showing a single-part (IPT-only) design.
However, there is some limited support if you make the part be an occurrence in an assembly, and change the DVR of the occurrence. In that scenario, C360 still does not show the DVR immediately, but will update the display to show the correct DVR in the secondary "overlay" which comes in within a second or two after moving the view or changing the model. This may or may not be sufficient for your needs.
In addition, C360 respects the DVR specified in drawing-views (in IDW's or DWG's).
PS. Here are the files I used to test it. Use the IPT by itself, and you'll see it won't really work. Use the IAM (i.e., upload the whole zip file to C360), and you'll see the drawing works, and the IAM display works after a delay.
is that possible to do the same action but inside an Children occurence?
i mean: to change the view representation inside an assembly?
i want to change a view of EscadaPhantom using ilogic from 100000165.
is that possible?
kelly.young has embedded your image for clarity.
Hi. see code below.
first part for the actual assembly. Second part for a specific subcomponent.
-------------------------------------------
Sub Main()
''this is for main assembly
Dim oDoc As Document
oDoc = ThisDoc.Document
Dim oAssyDoc As AssemblyDocument
oAssyDoc = TryCast(oDoc, AssemblyDocument)
If oAssyDoc Is Nothing Then
MessageBox.Show("Document not of Assembly Type")
Exit Sub
End If
Try
oAssyDoc.ComponentDefinition.RepresentationsManager.DesignViewRepresentations("Default").Activate
oAssyDoc.ComponentDefinition.RepresentationsManager.LevelOfDetailRepresentations("Custom").Activate
Catch
MessageBox.Show("Unable to find 'Custom' LOD on " & oAssyDoc.DisplayName)
End Try
'this Is For Specific Occurrences
Dim oOccs As ComponentOccurrences
oOccs = oAssyDoc.ComponentDefinition.Occurrences
For Each oOcc As ComponentOccurrence In oOccs
If oOcc.Name = "Specific Subcomponent" Then
Try
oOcc.SetDesignViewRepresentation("Default")
oOcc.SetLevelOfDetailRepresentation("Custom")
Catch
MessageBox.Show("Unable to find 'Custom' LOD on " & oOcc.Name)
End Try
End If
Next
End Sub
---------
Can't find what you're looking for? Ask the community or share your knowledge.