Inventor Engineer-to-Order

Inventor Engineer-to-Order

Reply
Member
DavidLong
Posts: 5
Registered: ‎01-03-2013
Message 1 of 11 (298 Views)

Custom drawing views

298 Views, 10 Replies
01-03-2013 07:45 AM

Custom drawing views

 

I am trying to add an IvBaseView from a custom angle.  When I try to set “viewOrientation = :Arbitrary”, I get a "Type mismatch error."  I am also trying to use the parameters cameraTarget, cameraEye, cameraUpVector, etc, but the drawing doesn’t change when I update the values.

 

What is the best way to add views from specific angles?

Member
DavidLong
Posts: 5
Registered: ‎01-03-2013
Message 2 of 11 (278 Views)

Re: Custom drawing views

01-08-2013 09:56 AM in reply to: DavidLong
If I can't create a customized view at render time, can I add additional features to a template drawing without deleting the existing sheet? 
 
For example, to add a GeneralNote, I need to specify the sheet (as a part).  How would I set this sheet to the original "Sheet:1" of my template?
Board Manager
Jon.Balgley
Posts: 243
Registered: ‎08-23-2006
Message 3 of 11 (245 Views)

Re: Custom drawing views

01-23-2013 07:59 PM in reply to: DavidLong

[Better late than never...]

 

You can definitely create custom (aka arbitrary) views.  I just tried it (in 6.1 R2, just released last week), and it worked in a simple test case.  The important parameters are:

 

(These are pulled from the dynamic rules ... I entered them interactively rather than writing a new design)

 

Parent Rule viewOrientation As Name = :arbitrary
Parent Rule cameraEye As Point = point(-200, -200, -200)  
Parent Rule cameraTarget As Point = root.origin
Parent Rule cameraUpVector As Vector = vector(-1,-1,0)

 

(This is essentially a bottom-iso view.)

 

Image-0354.png

 

When I changed to the camera up vector to an illegal value, the view disappeared with no error.  That's a defect -- should give an error.   But when I changed it to a different legal value, then the view updated as expected.

 



Jon Balgley
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Board Manager
Jon.Balgley
Posts: 243
Registered: ‎08-23-2006
Message 4 of 11 (244 Views)

Re: Custom drawing views

01-23-2013 08:02 PM in reply to: DavidLong

Re: adding notes to template drawings.  I can't recommend this procedure.  Maybe you can get it to work using the Inventor API, but the design isn't "designed" to work that way.



Jon Balgley
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Member
DavidLong
Posts: 5
Registered: ‎01-03-2013
Message 5 of 11 (231 Views)

Re: Custom drawing views

01-24-2013 02:44 PM in reply to: DavidLong

A standard view works with no problems:

	Child TestView2 As :IvBaseView
		viewOrientation = :IsoTopRight
		Model = model
		viewScale = .025
	End Child

 

 

A custom view results in an error:

	Child TestView As :IvBaseView
		viewOrientation = :arbitrary 
		Model = model
		viewScale = .025
		origin = Point(0,0,0)
		cameraEye =  Point(-200, -200, -200)
		cameraTarget = root.origin
		cameraUpVector = Vector(-1,-1,0)
	End Child

 

Error:

Exception in function iv_updateSheet

 Exception in function iv_createBaseView

 Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

 

Any ideas?

Board Manager
Jon.Balgley
Posts: 243
Registered: ‎08-23-2006
Message 6 of 11 (226 Views)

Re: Custom drawing views

01-24-2013 03:17 PM in reply to: DavidLong

Still works for me.  

 

What release are you using?  I don't think this should matter as long as you're running something fairly recent, because I took a quick look at the history of the related system code, and didn't see any relevant recent changes, but maybe I missed something.

 

Here are my sample rules:

 

	Child view1 As :IvBaseView 
		viewOrientation = :isoTopRight
		model = root 
		viewScale = 0.25
		origin = Point(150,200,0)
	End Child

	Child view2 As :IvBaseView 
		viewOrientation = :arbitrary
		model = root 
		viewScale = 0.25
		cameraEye = Point(100, 0, 50)
		cameraTarget = root.origin
		cameraUpVector = Vector(0,0,1)
		origin = Point(300,200,0)
	End Child

 

2013-01-24_1510.png

 

Note that the exact 'eye' and 'target' points really matter.  They have to be sized properly for your model.  At least in terms of orientation.  In my example above, the model is about 200mm square, and a little more than that in the Z direction.  So when I change the Z-coordinate of the cameraEye value, I get a higher-or-lower view, but still from the side.

 

 



Jon Balgley
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Board Manager
Jon.Balgley
Posts: 243
Registered: ‎08-23-2006
Message 7 of 11 (223 Views)

Re: Custom drawing views

01-24-2013 03:19 PM in reply to: Jon.Balgley

PS.  The only thing that I see that could possibly be different from your iso view vs. your arbitrary view is "root.origin".  Should that be "model.origin" instead?



Jon Balgley
Autodesk Configurator 360 / Inventor ETO team
Autodesk, Inc.

Member
DavidLong
Posts: 5
Registered: ‎01-03-2013
Message 8 of 11 (212 Views)

Re: Custom drawing views

01-24-2013 11:18 PM in reply to: DavidLong

Thank you for your attention.

 

I am using 5.1.

 

For the case I am testing, root.origin and model.origin are the same point.  I have experiemented with a variety of values for the various camera parameters, and I always get the same type mismatch error.  The part is definitely at the origin, so I expect that I should be able to look at that point from anywhere and see the part.  I don't think those values are the issue.

Mentor
FarrenYoung
Posts: 263
Registered: ‎07-13-2009
Message 9 of 11 (195 Views)

Re: Custom drawing views

02-04-2013 03:34 PM in reply to: Jon.Balgley

I am also having a problem with this functionality in 5.1.

 

Your code works correctly only if the model is root.

If I change the model to root.SubAssembly I get the following error:

 

Exception in function iv_updateSheet
 Exception in function iv_createBaseView
 Type mismatch. (Exception from HRESULT: 0x80020005 (DISP_E_TYPEMISMATCH))

If I change the viewOrientation to :IsoTopRight  it will draw correctly.

--Farren

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Active Contributor
morgangardiner
Posts: 27
Registered: ‎05-13-2008
Message 10 of 11 (90 Views)

Re: Custom drawing views

10-30-2013 02:35 PM in reply to: DavidLong

Jon;

could you explain how to determine what the Point would be if I wanted a view (using your example) that was rotated  45 degrees in the negative direction. ( this would put the 45 degree angle at 0 degrees and looking straight at you in the view.

or another example I want a view with the camera 29 degrees up from 0 about the z axis.

and what does cameraUpvector actually do.

 

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.