Tuesday 2 October 2012

Creating New View's

I have decided that I want to be able to export from my model certain categories of object for use in QTO (Check out QTO if you are interested in the quantification of elements within your model).

In order to do this I think it would be easiest if I clicked a button and views were made that are 3D with a particular category isolated.

This seemed to be easy in my head, I had already found out how to generate a new view, for example to make a new drafting view and set it as the current view I used:


Public Sub CreateNewDraftingView(ViewName As String)
        Dim uidoc As UIDocument = IncomingCleanup.uiapp.ActiveUIDocument
        Dim doc As Document = uidoc.Document
        Using tx As New Transaction(doc)
            tx.Start("Create Drafting View")
            Dim myDraftingView As ViewDrafting = doc.Create.NewViewDrafting()
            myDraftingView.ViewName = ViewName
            tx.Commit()
            uidoc.ActiveView = myDraftingView
        End Using
    End Sub

(By the way, for anyone interested in how to get colour coded text, all I do is copy the text from Visual Studio into Word 2010 then copy that text into Blogger)

to run it I simply need to use:

CreateNewDraftingView("Drew's Magic View")

so I figured it would be just as easy to make a 3D view, however, it turns our that's not the case...


Dim my3DView As View3D = View3D.CreateIsometric(doc,.......

is kind of what I need, however I need the ViewFamilyTypeID of a 3D view and I am a little stumped on how to get that, especially if I dont have existing 3D views in the project


I am going to go figure out how to do it and report back with this and how to then isolate categories in the view prior to exporting to DWF. 

No comments:

Post a Comment