Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Autogenerating geometry in Livelink with Geometry

Please login with a confirmed email address before reporting spam

I am trying to autogenerate geometry in Livelink with MATLAB using for loops. Specifically, I am trying to make a series of concentric spheres. However, I am having trouble due to the fact that each time I create a new object it needs a new string for a name for the variable. It then gives me an error whenever I try to autogenerate the names with the for loops. For example, for n=1:10 sq+n = geometry.feature.create('sq'+n,'Square'); end

Is there a good online resource regarding this?


1 Reply Last Post 13 nov 2019, 15:15 CET
Lars Gregersen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 4 years ago 13 nov 2019, 15:15 CET

See how uniquetag is used here: https://www.comsol.com/blogs/automatically-handling-selections-comsol-multiphysics/

'sq'+n most likely doesn't work like you think.

-------------------
Lars Gregersen
Comsol Denmark
See how uniquetag is used here: https://www.comsol.com/blogs/automatically-handling-selections-comsol-multiphysics/ 'sq'+n most likely doesn't work like you think.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.