Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

plae a view in a drawing

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
372 Views, 11 Replies

plae a view in a drawing

i want to add a drawing view. I have the name and location and the scale and where i want it located and everything about it all predifined in code. the only command that i can find pops up the create view dialog window. is ther eanother code or some way to set all the properties and info in this code so that the view is placed automaticaly?
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

Hi,

I hope you want to create a drawing view on the sheet; if so try this
"DrawingViews.AddBaseView"


BGeorge
Message 3 of 12
Anonymous
in reply to: Anonymous

If you want to add a FlatPattern view try this: 'Create FlatPattern Option Set oOptions = InventorApp.TransientObjects.CreateNameValueMap Call oOptions.Add("SheetMetalFoldedModel", False) Set oDrawView(1) = oSheet.DrawingViews.AddBaseView(oModel, oCoord(1), oScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle, "FlatPattern View", , , oOptions) Replace "InventorApp" with "ThisApplication" if you want to test this in VBA. Cheers, Teun "BGeorge" wrote in message news:26535429.1085720570164.JavaMail.jive@jiveforum2.autodesk.com... > Hi, > > I hope you want to create a drawing view on the sheet; if so try this > "DrawingViews.AddBaseView" > > > BGeorge
Message 4 of 12
Anonymous
in reply to: Anonymous

I tried this but i dont seem to be able to use the .addbaseview. here is the code, am i doing something wrong?

'this part of the code is just so you know what dwgref is, i
'have it defined properly in a different sub
dim dwgref
set dwgref = "w:\inventor\forinstance.idw"

'this is the part that is not working
Dim odwg As DrawingView
Set odwg = dwgref.Sheets(1).DrawingViews.addbaseview

and just in case this may be the casue i am using vba.

many thanks
Message 5 of 12
Anonymous
in reply to: Anonymous

I cant find it in my object browser either... 😕 anyu other work arounds that you gent's may know?
Message 6 of 12
Anonymous
in reply to: Anonymous

are there any addons that i can get that would giv eme that method?
Message 7 of 12
Anonymous
in reply to: Anonymous

Ok, here goes... 1) Copy-past the code below into your default.ivb 2) Create a part, save it as "C:\Test.ipt" 3) Run the sub Sub CreateView Dim oTemplate As String Dim oDoc As DrawingDocument Dim oSheet As Sheet Dim oModel As PartDocument Dim oOptions As NameValueMap Dim oTransGeom As TransientGeometry Dim oCoord As Point2d Dim oHeight As Integer Dim oWidth As Integer Dim oScale As Double Dim oDrawView As DrawingView 'Create fabrication drawing from template, change this to your own template!!! oTemplate = "C:\Program Files\Autodesk\Inventor 8\Templates\Standard.idw" Set oDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, oTemplate) 'Set active sheet Set oSheet = oDoc.ActiveSheet 'Create 2D Point for placement of view oHeight = oSheet.Height * 1 / 2 oWidth = oSheet.Width * 1/2 Set oTransGeom = ThisApplication.TransientGeometry Set oCoord = oTransGeom.CreatePoint2d(oWidth, oHeight) 'Set Model Set oModel = ThisApplication.Documents.Open("C:\Test.ipt", False) 'Set scale oScale = 1 / 5 'Create normal view Set oDrawView = oSheet.DrawingViews.AddBaseView(oModel, oCoord, oScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle) 'Create FlatPattern Option Set oOptions = InventorApp.TransientObjects.CreateNameValueMap Call oOptions.Add("SheetMetalFoldedModel", False) 'Create flatpattern view Set oDrawView = oSheet.DrawingViews.AddBaseView(oModel, oCoord, oScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle, "FlatPattern View", , , oOptions) MsgBox "Done" End Sub "stibbetts" wrote in message news:7148409.1085743484385.JavaMail.jive@jiveforum2.autodesk.com... > I cant find it in my object browser either... 😕 anyu other work arounds that you gent's may know?
Message 8 of 12
Anonymous
in reply to: Anonymous

right, and thatnk you very much for taking the time to do that for me but the problem is that in the line:

Set oDrawView = oSheet.DrawingViews.AddBaseView(oModel, oCoord, oScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle)

the only methods that i have available after 'osheet.drawingviews' are count, item, and type. if i run the code as you gave it to me i get a, 'object doesnt support this property or method' error 😕
Message 9 of 12
Anonymous
in reply to: Anonymous

Are you working with IV8 SP1? "stibbetts" wrote in message news:22364542.1085757637994.JavaMail.jive@jiveforum2.autodesk.com... > right, and thatnk you very much for taking the time to do that for me but the problem is that in the line: > > Set oDrawView = oSheet.DrawingViews.AddBaseView(oModel, oCoord, oScale, kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle) > > the only methods that i have available after 'osheet.drawingviews' are count, item, and type. if i run the code as you gave it to me i get a, 'object doesnt support this property or method' error 😕
Message 10 of 12
Anonymous
in reply to: Anonymous

ummmm.... no, sorry i didnt specify. I work on antique software because I live in the sticks of maine. Mine is Inventor 5.3 sp1 and sp2 (high class 😉 )
Message 11 of 12
Anonymous
in reply to: Anonymous

Than I am afraid that you don't have these methodes, sorry. Perhaps you should consider to upgrade to IV9 when it comes out :-) "stibbetts" wrote in message news:25488216.1085758383830.JavaMail.jive@jiveforum2.autodesk.com... > ummmm.... no, sorry i didnt specify. I work on antique software because I live in the sticks of maine. Mine is Inventor 5.3 sp1 and sp2 (high class ;-) )
Message 12 of 12
Anonymous
in reply to: Anonymous

I wonder if there is no way that i can actually insert the drawings with my antequated software is ther esom eway that I can chang ethe drawing that is already there? i could create a template with the 6 views that i need on it and then just changfe the files referenced through vba for different parts. any thoughts on how to accomplish this?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report