simos421/CST-MATLAB-API

Issue when invoking some properties

Closed this issue · 8 comments

Hi,

First of, thank you so much for these examples, it is very straighfoward and simple to follow! Was doing some more configurations that I need and, I'm trying to extrude a curve (or face but I cannot seem to pick the face even though I call the following: invoke(obj.mws,'Pick','PickFaceFromId', ['component', num2str(1),':','face', num2str(1)],'1');).

Anyways, I invoke the Extrude curve but, apparently, it does not recognize the "Thickness" and other parameters of the 'CoverCurve' (commented in the figure). Is this a problem with versions or something? I really cannot grasp what I'm missing
image
image

Best,
Tomás

Just to add aditional information, this is the macro I attain from just doing the operation in CST (2022)
image

Hi Simos,

Thank you for the fast reply, apologies if you received an email with a previous response but I put the wrong images. I do agree with you that the best way to work with you method is trying in CST and then translating into MATLAB. I did manage to do the work around with Extrude Curve but the pick method seems very useful hence I'm trying to get it to work.

Pick method:
CST Macros
image
image

MATLAB equivalent
image
image

Am I doing something wrong or do you know more in depth how to get the pick command to work, i.e., if I should propagate it into someplace?

Hi Simos,

Apologies for the late reply, I actually got it to work. My goal was to generate the 3d surface from MATLAB in CST, this a workaround to that (for a 1D version). However, since I only know how to create and import .STL, I'll take the opportunity to ask you if you happen to know a way to draw the surface dynamically in MATLAB? For instance, connecting the points consecutively using polygon3D so that when you cover, you actually get the surface, i.e., draw the surface the surface like you said.

Regarding the initial question, I managed to solved it with Pick. In case you happen to need in future situations:

  • you can actually input the specified pick surface/component by adding an additional argument in Extrude (it is a minor detail but I guess important since there is no documentation available on CST), i.e.,
    PickFace = invoke(obj.mws,'Pick');
    invoke(PickFace,'PickFaceFromId', ['component', num2str(1),':','face', num2str(1)],'1');
    ExtrudeSurface = invoke(obj.mws,'Extrude','PickFace');
    ...
    invoke(ExtrudeSurface,'Create'); and release both
    Note: For some reason the invoke does not work for commands if you concatenate them, e.g., Pick or Delete: invoke('Pick','PickFaceFromId', ['component', num2str(1),':','face', num2str(1)],'1');

In case you happen to know a easy way to generate the surface or the answer to the Note, lemme know!

Best,
Tomás

Also, do you happen to know which parameter it is so that, when I delete, I do not get stuck in the window
image

The MATLAB macro is simply the following:
image

Apologies for continuously asking but this last one would be particularly helpful!

Hi Simos,

Regarding the delete/results may be incomplete window (Maybe this is helpful for someone afterwards):

I tried to find more information and read other existing code, for instance the link , and it seems it is a new "feature" of recent versions of CST. As it is said in the discussion, alot of people encounter it, as end up stuck in the window like me. Anyways, besides the workaround suggested in the forum (use invoke('DeleteResults') before building new geometry), I found that you can also utilize invoke('Rebuild') to clear any existing geometries. The latter only requires that you re-do the solver parameters.

Regarding the complex geometry:

Yes! I have a rather complex surface (gaussian style as you said) that I generate in Matlab and I'm trying to figure how what is the best solution to "import it" in CST. I already tried building with bricks, cylinders, and spheres, but it is unfeasible and very very challenging. I also agree that it would be very interesting to have an .m function like that in the API, I'll try to find a video and think about one, we can try merging with your current API if you're still interested. If you happen to discover or find a way lemme know!

Best,
Tomás