Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

materials not applied

6 REPLIES 6
Reply
Message 1 of 7
VanessaGrimoult
520 Views, 6 Replies

materials not applied

hello,

i don't understand why the material doesnt applied,

here is my code:

 

 

Dim state As Autodesk.Navisworks.Api.Interop.ComApi.InwOpState10
state = Autodesk.Navisworks.Api.ComApi.ComApiBridge.State

Dim PresenterPlugin As Autodesk.Navisworks.Api.Interop.ComApi.InwOwPresenterElement = Nothing
 Dim plugin
 For Each plugin In state.Plugins
   If plugin.ObjectName = "nwOwPresenterElement" Then
         PresenterPlugin = plugin
      MsgBox(PresenterPlugin.ToString, MsgBoxStyle.OkOnly," Presenter Plugin OK")
          Exit For
   Else
      MsgBox(" Presenter Plugin non  détecté")

   End If
Next

 PresenterPlugin.UserMaterials.AddFromArchive("Aluminium poli")
                    
 If state.CurrentSelection.Paths().Count > 0 Then
      For Each path As InwOaPath In state.CurrentSelection.Paths()
      PresenterPlugin.MaterialMappings().AddMapping("Aluminium poli", path, True)
      Next
 Else
       MsgBox("la selection est vide")
 End If

 the presenter plugin is detected and the material is added to the UserMaterial list

but the material is not applied to the currentSelection

and there is no Error Msg.

do i miss something?

thanks for help

vanessa

6 REPLIES 6
Message 2 of 7

Hi,

 

My questions:

- is this a Control based application, or a plugin?

- does this issue happen with any model or specific model? 

- does hit issue occur with any material or specific one?

Message 3 of 7

hi, thanks for your help

so, this is a Plugin,

and this morning i have tried differents materials and differents models, it still doesn't apply

i understand plugin  Presenter works only with Com APi, but i suppose i can work with it if i use APIBridge in .NET?

i really don't understand where is the problem !

 

Message 4 of 7

Hi,

 

sorry I was not able to get back soon. 

 

The blog below is what I wrote on presenter. It can still work. Note: from Navisworks 2015, Presenter and the relevan API are removed.

http://adndevblog.typepad.com/aec/2013/12/working-with-presenter-by-api.html

 

Could you check the blog if it helps you to figure out your problem?

Message 5 of 7

hi, yes i have already read this blog, it help me to write the code you can see in my first post as i say in the precedent post, the plugin Presenter is found and the material is added in the palette but not applied on my model. i don't undestand why. i use this code in a addinPluggin and i use Navisworks simulate 2013 where is the problem? thanks vanessa
Message 6 of 7

Hi,

are you still having the issue? If yes, could you share a demo code project and the model file? I doubt the object has been overridden with other rendering..
Message 7 of 7

Hi,

Unfortuately this Question is still unanswered.

 

I'm trying to change some materials and got stuck.

Can you please provide the demo code for me?

 

I am working with .Net Studio with the ComApiBridge and Navisworks 2014

 

Thanks!

 

Andreas

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

Post to forums  

Rail Community


Autodesk Design & Make Report