Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Referencing macro in current filament's directory?

    Scheduled Pinned Locked Moved Solved
    Tuning and tweaking
    3
    5
    252
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • paralepsisundefined
      paralepsis
      last edited by

      Hi,

      I'd like to have the ability to define some new macros on a per-filament basis. I don't see the specific filament in the object model, but even if I did I'm not sure how I would structure a call to use it.

      Can someone give me an example M98 that would reference a file "foo.g" in the current filament directory?

      Thanks!

      Railcore II 300XL w/ Duet 3 & RRF 3.5rc4, Makerbot R2X w/ Duet 2 WiFi & RRF 3.4

      deckingmanundefined 1 Reply Last reply Reply Quote 0
      • deckingmanundefined
        deckingman @paralepsis
        last edited by deckingman

        @paralepsis The structure is like this.....

        M98 P"foo.g" will access a macro in the /sys folder (not something that many people do)

        M98 P"0:/macros/foo.g" will access the macro if it's in a folder called "macros" which is in the root of the SD card at the same level as /sys

        M98 P"0:/macros/filaments/foo.g" will access the macro if it's in folder called "filaments" which is itself a sub folder of "macros".

        Ian
        https://somei3deas.wordpress.com/
        https://www.youtube.com/@deckingman

        paralepsisundefined 1 Reply Last reply Reply Quote 0
        • paralepsisundefined
          paralepsis @deckingman
          last edited by paralepsis

          @deckingman understood. What I'm trying to do though is reference a macro inside a specific directory within the filament directory (e.g., "0:/macros/filaments/Overture PETG 20220908/foo.g"), but in a way that pulls the filament directory name from a variable.

          Something is doing this to execute the correct config.g from that directory on a M703, but it's unclear how to do this myself...

          Thanks!

          Railcore II 300XL w/ Duet 3 & RRF 3.5rc4, Makerbot R2X w/ Duet 2 WiFi & RRF 3.4

          chrishammundefined 1 Reply Last reply Reply Quote 0
          • chrishammundefined
            chrishamm administrators @paralepsis
            last edited by

            @paralepsis Are you looking for something like this?

            M98 P{"0:/filaments/" ^ move.extruders[0].filament ^ "/foo.g"}
            

            Duet software engineer

            paralepsisundefined 1 Reply Last reply Reply Quote 2
            • paralepsisundefined
              paralepsis @chrishamm
              last edited by

              @chrishamm Yes, I think that might be the magic I'm looking for; thanks!!

              Railcore II 300XL w/ Duet 3 & RRF 3.5rc4, Makerbot R2X w/ Duet 2 WiFi & RRF 3.4

              1 Reply Last reply Reply Quote 1
              • chrishammundefined chrishamm marked this topic as a question
              • chrishammundefined chrishamm has marked this topic as solved
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA