.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

selecting elements and color change

1 REPLY 1
Reply
Message 1 of 2
beeola2000
368 Views, 1 Reply

selecting elements and color change

I am trying to program navisworks and dont know how to start. Can anyone help me with a code to select elements e.g a door in navisworks and how to change the door color.

1 REPLY 1
Message 2 of 2
quigs
in reply to: beeola2000

Hi there,

I don't know what Navis works is, and I'm also a n00b, but maybe this would help you ou.:

 

Public Class SelectObject
    <CommandMethod("SelectObject")> _
    Public Sub SelectObject()
        Dim myDWG As Document = Application.DocumentManager.MdiActiveDocument
        Dim myPER As PromptEntityResult = myDWG.Editor.GetEntity("Select:")
        Using myTrans As Transaction = myDWG.TransactionManager.StartTransaction
            Dim myEntity As Entity = myPER.ObjectId.GetObject(OpenMode.ForWrite)

            'Color
            myEntity.ColorIndex = 3

            myTrans.Commit()
            myEntity.Dispose()
        End Using
    End Sub
End Class

My name is Martin.. 😄

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost