Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Journal)
  • No Skin
Collapse
Brand Logo

D2P Community

S

sus

@sus
administrators
About
Posts
4
Topics
2
Shares
0
Groups
1
Followers
0
Following
0

Posts

Recent Best Controversial

  • Create a Cadwork material group using c++ API
    S sus

    Here is a snippet working for me

    	// convert string to wstring
    	std::wstring ToWideString(std::string narrowString)
    	{
    	    return std::wstring_convert<std::codecvt_utf8<wchar_t>>().from_bytes(narrowString);
    	}
    
    
    	void CreateMaterial(CwAPI3D::MaterialController* mc) {
    		// get the string value of the material
    		auto newMaterialNameWS = ToWideString(Value);
    		auto newMaterialNameCS = newMaterialNameWS.c_str();
    		// check if the material exists
    		auto material_id = mc->getMaterialID(newMaterialNameCS);
    		
    		if (material_id == 0) {
    			// if the material does not exist, create it
    			material_id = mc->createMaterial(newMaterialNameCS);;
    			// set the material group to switchboard materials
    			mc->setGroup(material_id, L"Switchboard_Materials");
    		}
    	}
    
    
    

  • Create a Cadwork material group using c++ API
    S sus

    Giving any free string in setGroup seems to do the trick. I still have an issue with the material name itself, will post a full snippet when solved.


  • Create a Cadwork material group using c++ API
    S sus

    I am trying to create a new material group using the C++ Cadwork API.

    Using the UI, I would use the "new material group" button :
    c1621406-e22d-4972-bc17-b7481aca2432-image.png

    Is that function currently available in the API ?

    The ICwAPI3DMaterialController allows me to getGroup or setGroup but not createGroup.

    Thanks a lot,
    Sylvain


  • Change mouse sensitivity ?
    S sus

    Is there a way to change the mouse sensitivity ?
    Rotating and panning feels quite sluggish.
    Thanks !

  • Login

  • Don't have an account? Register

Powered by NodeBB Contributors
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups