Dynamic 2-dimensional array

Lasers also do this, for example. On the one hand, they require the perfect focus and this varies depending on the height of the material on the bed (here the bed often moves to Z height, not the tool itself). This Z-height is also adjusted during cutting when several passes are made. I think this could well be a laser.

Actually it is just a felt tip pen :wink:

1 Like

That’s not NEARLY as fun as lasers.

1 Like

Well we‘re testing different versions for marking stainless steel and coppertubes.
One of them being a laser which needs too much power for marking in copper. The third one being a ink print head (o;

Is this high volume?

The intention is just to test the electronic and mechanical setup as Xojo makes it easy to build a simple GUI to test it.

In the end it will be an embedded controller design.

Waterresitant Ink from HP Cartridge is a perfekt way to do this. I do it all the time

Yeah we have a specific model in focus

Biggest problem there is the adapter PCB with the loads of small connectors :wink: And yeah, there‘s the strict timing of pulses to drive the heat elements. But Verilog is your friend there (o;

We’re wandering away from Xojo code discussion but this is just so interesting! Isn’t this a problem someone else has solved (printing on metal tubing)? Do you have special needs?

Yeah sorry for that
.but thougt I had to clarify on the Z axis (o;

I‘m sure someone else solved the problem
but my job is to do a simple application for testing markings on steel pipes.

Final product is an automated pipe cutter which draws information from a BIM system, draws information and marks on the pipe and cuts it to the right length.

But hope to get some time this weekend to test the hints I got here in Xojo what fits best.

Here‘s a picture of my test setup :wink:

2 Likes

BTW: The last time I built an application with Xojo was for settings parameters in an orbital welding machine.

The firmware within reported the available parameters and limits, and Xojo drawed the user interface dynamically for setting them.

Always love to see people using Xojo to control hardware.

1 Like


which is preferable to the alternative
:slight_smile:


(image from PikBest)

1 Like

Been fiddling today now with a Class as suggested
but getting only Nil access errors, parameters not compatible or “Expected Class Xojo.Point but got Class Xojo.Point” (o;

So in the Class Letter I added two properties, Character as String and Paths as Point.
In a module I declared a property allLetters as Letter so I can reference it in the Window open event. But here is where I got lost for now (o;

What I try to achieve with this:

Dim aLetter as Letter
Dim a() as Point
Dim p() as Point

// Letter A first path: "/\"
a.Append New Point(0,0)
a.Append New Point(2.71,6.04)
a.Append New Point(5.43,0)
p.Add(a) // This throws error Parameters are not compatible with this function

a.RemoveAll
// Letter A second path: "-"
a.Append New Point(4.47,2.12)
a.Append New Point(0.95,2.12)
p.Add(a)

aLetter.Character = "A"  // This throws a Nil Exception error
aLetter.Paths = p // This throws "Expected class Xojo.Point, but got class Xojo.Point"

p.RemoveAll

allLetters.Add(aLetter)

is to specify the points in “a” where the marker moves. If all points are set for the path, it is added to “p”. This continues until all paths are added.

Finally the paths are added to aLetter together with the Character set to “A”. This then goes into property allLetters.

All this Classes, properties and Arrays are way confusing for a Python/PHP guy like me (o;

Okay
when I replace Point with Variant for the Path it runs, but throws again NilObjectException with:

aLetter.Character = "A"
aLetter.Paths = p

Maybe you want 
as New Letter
 here.

1 Like

As @AlbertoD says, you have to instantiate aLetter using New in order for it not to be Nil. You might also want to add a Constructor method so you can do something like

aLetter = new Letter("A", p)

and eliminate the need to assign the properties in separate lines.

And doesn’t the Paths property of Letter need to be an array, i.e. Paths() as Point?

Just read about Dim as New
makes total sense (o;

When I use

Dim p() as Point

It throws me the error that “Parameters are not compatible with this function”:

p.Add(a)

With Dim p() as Variant it works


Now I get a NilObjectException with:

allLetters.Append(aLetter)

I just added an empty method to the letter property with parameter as:

Bildschirmfoto 2024-08-05 um 15.51.15

So somehow allLetters is uninitialized as well, but no clue where to initialize the property:

Bildschirmfoto 2024-08-05 um 16.01.05

Don’t even know how to go further then (o;

If you

Dim p() as Point

then you can only add objects that are of type Point to that array. Here, you’re adding a Letter object:

p.Add(a)

You’ll need to

Dim allLetters() as Letter

and then

allLetters.Add(a)

For now, until you’ve gotten the hang of how Xojo’s type system works, you should avoid using Variant. It will appear to make things work in the short term but will cause you pain in the long term unless you use it appropriately and sparingly. :slight_smile:

2 Likes