Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Python: SetCurrentLayer broken?!?

Python: SetCurrentLayer broken?!?

jens.diemer
Collaborator Collaborator
540 Views
1 Reply
Message 1 of 2

Python: SetCurrentLayer broken?!?

jens.diemer
Collaborator
Collaborator

Simple example code:

import MaxPlus
MaxPlus.LayerManager.CreateLayer("foobar")
MaxPlus.LayerManager.SetCurrentLayer("foobar")

 

A "foobar" layer will be created, but SetCurrentLayer() will result in a error:

 

-- Error occurred in anonymous codeblock; filename: test.ms; position: 250; line: 6
-- Runtime error:  Line 39  run()
 Line 30210  SetCurrentLayer()
  <type 'exceptions.NotImplementedError'> Wrong number or type of arguments for overloaded function 'LayerManager_SetCurrentLayer'.
  Possible C/C++ prototypes are:
    Autodesk::Max::LayerManager::SetCurrentLayer(Autodesk::Max::WStr const &)
    Autodesk::Max::LayerManager::SetCurrentLayer()

 

Why?

Jens

------------------------------------------------------------------------------------------------------------------
https://github.com/jedie/3dsmax_bugs | https://github.com/jedie/3dsmax_patches
0 Likes
541 Views
1 Reply
Reply (1)
Message 2 of 2

kevinvandecar
Community Manager
Community Manager

Sorry, but yes it appears this method is not implemented properly. In fact, it appears that any of those APIs athat are using a paramater of WStr as shown in the documentation are broken.

 

I have reported this as a defect: MAXX-22973

 

thanks,

kevin

 


Kevin Vandecar
Developer Technical Services
Autodesk Developer Network



0 Likes