Results 1 to 1 of 1

Thread: VBA Inventor 2013 : change material and clear override

  1. #1
    I could stop if I wanted to
    Join Date
    2001-07
    Posts
    319
    Login to Give a bone
    0

    Default VBA Inventor 2013 : change material and clear override

    Hello,
    I'm trying to write a macro for Inventor to change the material and clear the material override.
    I'm beginning with a part and will be extended to assembly (ies)
    I've put the material(name) I want in a Label.

    Is it the way to go?
    Thanks for any help
    Code:
    Public Sub ClearMaterial()
        Dim invDoc As Document
        Set invDoc = ThisApplication.ActiveDocument
        
        If invDoc.DocumentType = kPartDocumentObject Then
            Dim pcd As PartComponentDefinition
            Set pcd = invDoc.ComponentDefinition
            Dim mat As material
            Set mat.Name = Label1.Caption
            pcd.material = mat
        End If
    
    End Sub
    Attached Images Attached Images

Similar Threads

  1. Clear Font Override Inside Cells of Table Entity
    By harilalmn in forum VBA/COM Interop
    Replies: 0
    Last Post: 2011-03-10, 12:08 PM
  2. Override line weights by material inside a wall?
    By rjcoolpix880 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2010-02-12, 01:35 AM
  3. Override Material in View?
    By jkuhnle154184 in forum Revit Structure - General
    Replies: 2
    Last Post: 2008-04-01, 11:30 PM
  4. Material Override
    By steve459238 in forum ACA General
    Replies: 5
    Last Post: 2007-03-07, 08:51 AM
  5. GREYED OUT MATERIAL OVERRIDE
    By shenderson in forum Revit Architecture - General
    Replies: 3
    Last Post: 2007-01-30, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •