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: 

Creating Base View in idw

7 REPLIES 7
Reply
Message 1 of 8
paulschuepbach
527 Views, 7 Replies

Creating Base View in idw

Hi folks, I have a AssemblyDoc open and I want to create a dawing automatically. Therefor I create a new idw, using the default template. The I want to add a BaseView to the drawing. This all works fine, except when I want to create this BaseView using 'kCurrentViewOrientation' enum - it creates a FronView ???? The other orientation-enum's work fine. Is this a bug ? Any idea for a workaround ?

Best, Paul
7 REPLIES 7
Message 2 of 8
Anonymous
in reply to: paulschuepbach

I don't have an answer for your question, because I
am stuck at step 1: creating the base view itself.

 

The Helpfile is not of much help, not 1 clear
example.

 

I have this code (in de IDW), but I don't know how
to set the model (c:\test.ipt) as a document.

 

What should I change?

 

*****

 

Sub PlaceBaseView()

 

Dim oDoc As DrawingDocument
Set oDoc =
ThisApplication.ActiveDocument

 

Dim oTransGeom As TransientGeometry
Set
oTransGeom = ThisApplication.TransientGeometry

 

Dim oCoord1 As Point2d
Set oCoord1 =
oTransGeom.CreatePoint2d(0, 0)

 

Dim oModel As Document
Set oModel = Nothing
'<=== What should this be???

 

Dim oScale As Double
oScale = 0.2

 

Dim oDrawView As DrawingView
Set oDrawView =
oDoc.ActiveSheet.DrawingViews.AddBaseView(oModel,oCoord1,oScale,kCurrentViewOrientation,kHiddenLineRemovedDrawingViewStyle,,,,)
'<=== Is this correct???

 

End Sub

*****

 


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Hi
folks, I have a AssemblyDoc open and I want to create a dawing automatically.
Therefor I create a new idw, using the default template. The I want to add a
BaseView to the drawing. This all works fine, except when I want to create
this BaseView using 'kCurrentViewOrientation' enum - it creates a FronView
???? The other orientation-enum's work fine. Is this a bug ? Any idea for a
workaround ?

Best, Paul

Message 3 of 8
Burnit87
in reply to: Anonymous
Message 4 of 8
NachitoMax
in reply to: paulschuepbach

Hi

If it helps, I have nearly finished an addin that completely manages drawing views. With the tool you can-

Select the views you want on the sheet
Create a new drawing file for the active assembly
Create a new drawing file for each part in the assembly
Choose between drawing view and job pack view
Set the scale
Select between the view styles
Add the correct label text (front elevation and scale)
Create drawing files for selected parts in the assembly
Preview each part as it is clicked in a viewer

A few more days on the addin then it will be ready for the App Store.


Thanks

Nigel

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 5 of 8
Carthik_Babu
in reply to: Anonymous

hi,
u need to copy the code in part file for creation of automatic drawing views.
check the below link.....
http://forums.autodesk.com/t5/Inventor-Customization/Automated-DWG/m-p/4648777#M47390

download test auto.ipt, it has useful codes to automate the drafting process.

Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 6 of 8
NachitoMax
in reply to: Carthik_Babu

Hi

 

thanks for the reply. i downloaded the ipt but there isnt any code inside. i looked via the vba editor

 

Please advise

 

 

 

Thanks

 

 

Nigel

 

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 7 of 8

Hi, kindly check the code in Ilogic editor or paste my code (which is available in the previous link) in your ipt file Ilogic editor and check
Carthik Babu M.S, Asst Manager - Machine Building,
Gabriel India Ltd,Hosur, TN, INDIA
Email:carthik_ms@yahoo.co.in ,
https://grabcad.com/carthik-1/projects
"May all beings be happy" http://www.dhamma.org/
Message 8 of 8
Burnit87
in reply to: Carthik_Babu

im using this code to create a flat pattern on a new drawing including scaling and stuff

i hope it is of some help

 

Dim ActivIdw AsDrawingDocument = m_InvApp.ActiveDocument

Dim oSheet AsSheet = ActivIdw.ActiveSheet

Dim BsVwScale AsDouble

Dim prtProterty AsPropertySet = prtDoc.PropertySets.Item("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")

Dim prtWidth, prtLength AsDouble

prtLength = prtDoc.PropertySets.Item("Design Tracking Properties").Item("Flat Pattern Length").Value

prtWidth = prtDoc.PropertySets.Item("Design Tracking Properties").Item("Flat Pattern Width").Value

If prtWidth > prtLength Then

BsVwScale = Math.Round(1 / ((oSheet.Width - 20) / prtWidth), 2)

Else

BsVwScale = Math.Round(1 / ((oSheet.Width - 20) / prtLength), 2)

EndIf

SelectCase BsVwScale

CaseIs < 0.2

BsVwScale = 5

CaseIs < 0.5

BsVwScale = 2

CaseIs <= 1

BsVwScale = 1

CaseIs < 2.5

BsVwScale = 0.4

CaseIs < 5

BsVwScale = 0.2

CaseIs < 10

BsVwScale = 0.1

CaseIs < 25

BsVwScale = 0.04

CaseIs < 50

BsVwScale = 0.02

CaseIs < 100

BsVwScale = 0.01

EndSelect

Dim oViewPos AsPoint2d = m_InvApp.TransientGeometry.CreatePoint2d(oSheet.Width / 2, oSheet.Height / 2)

Dim prtDocBaseView AsDrawingView

Dim oOptions AsNameValueMap = m_InvApp.TransientObjects.CreateNameValueMap

Call oOptions.Add("SheetMetalFoldedModel", False)

prtDocBaseView = oSheet.DrawingViews.AddBaseView(PrtToInsert, oViewPos, BsVwScale, ViewOrientationTypeEnum.kDefaultViewOrientation, DrawingViewStyleEnum.kHiddenLineDrawingViewStyle, , , oOptions)

prtDocBaseView.DisplayThreadFeatures = False

BP

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

Post to forums  

Autodesk Design & Make Report