• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Autodesk Inventor Engineer-to-Order

    Reply
    Member
    Posts: 5
    Registered: ‎01-03-2013

    Custom drawing views

    194 Views, 8 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?

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎01-03-2013

    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?
    Please use plain text.
    Board Manager
    Posts: 196
    Registered: ‎08-23-2006

    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 Inventor ETO team
    Autodesk, Inc.

    Please use plain text.
    Board Manager
    Posts: 196
    Registered: ‎08-23-2006

    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 Inventor ETO team
    Autodesk, Inc.

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎01-03-2013

    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?

    Please use plain text.
    Board Manager
    Posts: 196
    Registered: ‎08-23-2006

    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 Inventor ETO team
    Autodesk, Inc.

    Please use plain text.
    Board Manager
    Posts: 196
    Registered: ‎08-23-2006

    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 Inventor ETO team
    Autodesk, Inc.

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎01-03-2013

    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.

    Please use plain text.
    Mentor
    FarrenYoung
    Posts: 247
    Registered: ‎07-13-2009

    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"
    ************************************************************************************
    Please use plain text.