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.

Using 'Convert to Solid' Object in Matlab Livelink: specifying a selection

Please login with a confirmed email address before reporting spam

I am scripting a simulation using the Matlab Livelink interface. I am able to build a geometry using and import object surface combined with parametric surfaces and I would like to convert this into a solid object.

I have already tested this through the GUI and it works fine. The geometry generated through the script also looks fine (i.e. edges match up).

However the problem is how to "feed" a selection to the convert to solid object:

          csol1 = geom1.feature.create('csol1','ConvertToSolid');

I can see that there is nothing selected when I type the following command in Matlab: csol1.selection('input')


2 Replies Last Post 2018年5月9日 GMT-4 20:36

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2018年5月9日 GMT-4 20:17

I figured it out.

I created a Cumulative selection as follows and then added the constituent geometric entities to it:

geom1.selection.create('sel1','CumulativeSelection');
imp1.set('contributeto','sel1');
pback.set('contributeto','sel1');
pforward.set('contributeto','sel1');
pbottom.set('contributeto','sel1');
pleft.set('contributeto','sel1');
pright.set('contributeto','sel1');

Then I created the ConvertToSolid object and assigned the selection to the input of csol1 as follows:

csol1 = geom1.feature.create('csol1','ConvertToSolid');
csol1.selection('input').named('sel1');

I know this works because I am now getting some topology error during the convert to solid operation. Progress.

I figured it out. I created a Cumulative selection as follows and then added the constituent geometric entities to it: geom1.selection.create('sel1','CumulativeSelection'); imp1.set('contributeto','sel1'); pback.set('contributeto','sel1'); pforward.set('contributeto','sel1'); pbottom.set('contributeto','sel1'); pleft.set('contributeto','sel1'); pright.set('contributeto','sel1'); Then I created the ConvertToSolid object and assigned the selection to the input of csol1 as follows: csol1 = geom1.feature.create('csol1','ConvertToSolid'); csol1.selection('input').named('sel1'); I know this works because I am now getting some topology error during the convert to solid operation. Progress.

Please login with a confirmed email address before reporting spam

Posted: 7 years ago 2018年5月9日 GMT-4 20:36

I fixed the topology error by setting the 'repairtoltype' property on csol1 to 'auto'.

I fixed the topology error by setting the 'repairtoltype' property on csol1 to 'auto'.

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.