How can we get a custom part camera view 0r design view representation through an assembly?

How can we get a custom part camera view 0r design view representation through an assembly?

Anonymous
Not applicable
302 Views
1 Reply
Message 1 of 2

How can we get a custom part camera view 0r design view representation through an assembly?

Anonymous
Not applicable

I created a design view representation in part with specific orientation and direction. i can get all camera information in part. but when i tried to get the information of  this design view representation of part through assembly, it return the assembly camera view information. 

how can i get the right camera information of part in an assembly?

 

ComponentOccurrenceProxy oComponentOCC =InventorApp.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select proxy");

DesignViewRepresentation getView = null;
AssemblyDocument oSubAssembly = oComponentOCC.ParentOccurrence.Definition.Document;
DesignViewRepresentations oDesignViewReps=oSubAssembly.ComponentDefinition.RepresentationsManager.DesignViewRepresentations;
foreach (DesignViewRepresentation oDesignView in oDesignViewReps)
{
if (oDesignView.Name=="FirstView")
{
getView = oDesignView;
UnitVector upVector=getView.Camera.UpVector;
break;
}
}

0 Likes
303 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @Anonymous.  I'm not great with C#, but it looks to me like you are getting a DVR (DesignViewRepresentation) that is defined within an assembly that the part is a component within, rather than getting the DVR from that part component's document directly.  That may be why it is not correct.  Is the DVR in the assembly named the same as the DVR in the part?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes