View Representation, set same Fixed Distance for all Views

View Representation, set same Fixed Distance for all Views

steveh5
Advisor Advisor
1,421 Views
6 Replies
Message 1 of 7

View Representation, set same Fixed Distance for all Views

steveh5
Advisor
Advisor

Gang...

 

Looking for a way to set all View Reps to the same Fixed Distance and model orientation.

 

Reason is that we have different configurations of our product and each configuration has it's own View Representation.

 

I am attempting to get consistent images from the View Reps so that when options/accessories are chosen, a new image will show the option/accessory being added.

 

With Inventor Studio, we can get photo realistic images fairly easily. We can get good quality images.

So, we would end up with a bunch of images for all the configurations.

 

The challenge we are having is setting the angle, perspective, pitch, and fixed distance to be exactly the same for each View Rep. 

 

Our goal is to give the illusion that options/accessories show up as if they were added to the base image, but in reality it's a unique image to that configuration. So, in order for the images to be consistent, they need to have the exact same 3D orientation and Fixed distance for all Views.

 

From what I have found, not sure this is possible. Possible with iLogic? 

 

Thanks for the help in advance,

 

Steve Hilvers

Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Accepted solutions (1)
1,422 Views
6 Replies
Replies (6)
Message 2 of 7

-niels-
Mentor
Mentor

If you're making the images in Inventor studio and using a camera, then you could add a (3D) sketch to your assembly that contains a fixed point.
You can define it with lines or a workpoint out in space.
Make the sketch only visible in the Master view rep and it won't bother you for the design views you want to create images from.

Then you just define your camera to this point and make sure the target stays the same as well...

 

---edit---

Found the post i made on this.


Niels van der Veer
Inventor professional user & 3DS Max enthusiast
Vault professional user/manager
The Netherlands

0 Likes
Message 3 of 7

mcgyvr
Consultant
Consultant
Accepted solution

@steveh5  Try this (I was in a rush and it may not do all you need but lets start here)..

To make it work go to one view rep and set the view exactly how you want it. Then run the rule and it "should" copy that view angle/position/zoom distance to all other view reps..

 

Dim oInventor As Application
Dim oDoc, Doc As Document

Dim oView, DocView As View
Dim oCamera, DocCamera  As Camera
Dim eye, target As Point
Dim upvector As UnitVector

'Get the active document and the active Camera Position
oInventor = ThisApplication
oDoc = oInventor.ActiveDocument
oView = oInventor.ActiveView
oCamera = oView.Camera
oCamera.GetExtents(CWidth, CHeight)

'Prepare Transient Geometry and copy Camera properties
Dim tg As TransientGeometry
tg = oInventor.TransientGeometry
eye = tg.CreatePoint(oCamera.Eye.X, oCamera.Eye.Y, oCamera.Eye.Z)
target = tg.CreatePoint(oCamera.Target.X, oCamera.Target.Y, oCamera.Target.Z)
upvector = tg.CreateUnitVector(oCamera.UpVector.X, oCamera.UpVector.Y, oCamera.UpVector.Z)

	
	
	
	'set a reference to the assembly component definintion.
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
'define view rep collection
Dim oViewReps As DesignViewRepresentations
oViewReps = oAsmCompDef.RepresentationsManager.DesignViewRepresentations
'define view rep
Dim oViewRep As DesignViewRepresentation
'define an arraylist to hold the list of view rep names
Dim NameList As New ArrayList()
'create a list of view reps
For Each oViewRep In oViewReps
NameList.Add(oViewRep.Name)
Next

Dim sName As String

'loop through each view rep
For Each sName In NameList
	oViewReps.Item(sName).Activate
	
	 DocView = oInventor.ActiveView
        DocCamera = DocView.Camera
        
        'Set camera perspective to apply camera settings
        'DocCamera.Perspective = True
        
        DocCamera.eye = eye
        DocCamera.target = target
        DocCamera.upvector = upvector
		DocCamera.SetExtents(CWidth, CHeight)
		
		   DocCamera.Apply
        DocView.Update
	
	

Next
	

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 4 of 7

steveh5
Advisor
Advisor

Phenomenal...exactly what I was looking for. iLogic works like a charm. Appreciate the quick response.

 

Take care,

 

Steve Hilvers

Steve Hilvers
Inventor Certified User / Vault Professional Influencer
Message 5 of 7

steveh5
Advisor
Advisor

So...iLogic is working superbly....looking to take this one step further.

 

Is it possible to set the Home View for each View rep at a fixed distance using iLogic?

 

See image....

Set home view.png

 

Thanks in advance.

Steve Hilvers
Inventor Certified User / Vault Professional Influencer
0 Likes
Message 6 of 7

steveh5
Advisor
Advisor

Never mind my last question.

 

Didn't think it was setting the fixed distance .... but it was. The Perspective vs Ortho View was gave me the illusion that it wasn't setting it.

 

Thanks,

Steve Hilvers
Inventor Certified User / Vault Professional Influencer
0 Likes
Message 7 of 7

G.Binl
Advocate
Advocate

Thanks this very helpful..

 

0 Likes