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

administrators

Private

Posts


  • 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


  • Willkommen im Cadwork-Community-Forum! 🥳
    D d2p

    Willkommen im cadwork-Community-Forum! 🎊

    Dieses Forum bietet dir die Möglichkeit, Fragen zu cadwork zu stellen, Best Practices auszutauschen und dich mit anderen Nutzern zu vernetzen, die ähnliche Interessen und Erfahrungen teilen.

    Das Forum ist kostenlos und für jeden zugänglich.

    Es wird von Design-to-Production unterstützt und moderiert. cadwork ist nicht verantwortlich für den Inhalt oder die Moderation dieses Forums. Bitte beachte, dass dies eine Community von Nutzern für Nutzern ist – wenn du technische Probleme oder Fehler entdeckst, wende dich bitte direkt an cadwork für Support.

    Denke daran, dass ein respektvoller Umgang miteinander entscheidend ist, damit das Forum ein angenehmer und produktiver Ort für alle bleibt. Sei höflich, hilfsbereit und respektiere die Meinungen und Erfahrungen anderer.


    Welcome to the cadwork Community Forum! 🎊

    This forum provides you with the opportunity to ask questions related to cadwork, share best practices, and connect with other users who have similar interests and experiences.

    The forum is free to use and open to everyone.

    It is supported and moderated by Design-to-Production. cadwork is not responsible for the content or moderation of this forum. Please note that this is a user-to-user community – if you encounter technical issues or bugs, please contact cadwork directly for support.

    Remember, maintaining a respectful and courteous atmosphere is key to making the forum a productive and welcoming space for all. Be polite, helpful, and considerate of others' opinions and experiences.


  • Change mouse sensitivity ?
    _ _m7

    Hallo Sylvain, hier sind noch einige Einstellungen, die Du noch testen kannst um die Grafik-Geschwindigkeit zu verbessern.
    05b6843d-912b-4109-8157-92c1ede9fa43-grafik.png

    cc2e67ad-e15f-4add-ab5c-85838603fdbc-grafik.png

Member List

D d2p
S sus
_ _m7
J jch
  • Login

  • Don't have an account? Register

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