Jump to content
goron

How to use the RunHMTclString() function?

Recommended Posts

Hi everybody,


 


I am working with HyperMesh using its External C/C++ API with Visual Studio 2005. I would just like to import a .stp model and after that process it. But I can not get it to import the required file. This is how I have tried so far:



bool model = false;
model = hm_api->ImportModel (HM_ExtAPI::STEP, "E:\WAP09Celsius1_Lucian\Verformungsmodell\99_Daten_CATPart\00_Werkstueck_eingriff.stp", true);
printf("model = %d \n", model);

for which the output is simply:



model = 0

And by using:



hm_api->RunHMTclString ("*feinputwithdata2 #granite\step E:/WAP09Celsius1_Lucian/Verformungsmodell/99_Daten_CATPart/00_Werkstueck_eingriff.stp 1 0 -0.01 0 0 1 1 1 0");

with the following output:



Error:   reader is not supported on this platform.
Tcl/Tk script error:
0
    while executing
"*feinputwithdata2 #granitestep E:/WAP09Celsius1_Lucian/Verformungsmodell/99_Daten_CATPart/00_Werkstueck_eingriff.stp 1 0 -0.01 0 0 1 1 1 0"

Any advice is helpful.


 


Cheers,


Lucian.


--


 


Share this post


Link to post
Share on other sites

Hi Lucian,


 


    I have met a similar problem. I am working with HyperMesh11.0 via Visual Studio 2010. I type an example program on HyperMesh Refenrence Guide, and its function is delete all free lines from the model and saves the model without lines in the same file.


    When the program runs to the follow sentence:



hm_api->RunHMTclString("*createmark lines 1 all")

    it will break off and tells me: "package require tbcload 1.4". But in fact I have found tbcload 1.7 in my <Altair_Home>. I wonder the problem will occur as long as the function RunHMTclString is invoked.But Idon't known how to solve it.The whole error message is as follow:



Tbcload error: couldn't load library "C:/Program Files/Altair/11.0/hw/tcl/tcl8.5.6/win64/lib/tbcload1.7/tbcload17.dll": this library or a dependent library could not be found in library path while executing "load {C:/Program Files/Altair/11.0/hw/tcl/tcl8.5.6/win64/lib/tbcload1.7/tbcload17.dll}"
("package ifneeded tbcload 1.7" script)
invoked from within "package require tbcload 1.4"

    Did you finally solve your problem and will you give me some advice? Thanks a lot! :) :)


    Cheers,


    Oscar.


Share this post


Link to post
Share on other sites

Hi,


    I have work out this problem.It is because of the version of HyperMesh.I Wonder there is something wrong with the HyperMesh 11.0 file, tbcload17.dll and tbcload17.lib, in the folder "C:/Program Files/Altair/11.0/hw/tcl/tcl8.5.6/win64/lib/tbcload1.7", or at least some problem linking HyperMesh 11.0 with VS2010.When I copy the file,tbcload17.dll and tbcload17.lib,from the folder "C:\Program Files\Altair\12.0\hw\tcl\tcl8.5.9\win64\lib\tbcload1.7" of HyperMesh 12.0,and replace the original file,tbcload17.dll and tbcload17.lib of  HyperMesh 11.0, The function hm_api->RunHMTclString will work!


    Wonderful :D


Share this post


Link to post
Share on other sites
Guest

Lucian,


 


in C/C++, the character '\' is used for escape sequences, i.e a new lines. For windows paths, you should use '\\'. 


 


Try changing your code to:


 




bool model = false;
model = hm_api->ImportModel (HM_ExtAPI::STEP, "E:\\WAP09Celsius1_Lucian\\Verformungsmodell\\99_Daten_CATPart\\00_Werkstueck_eingriff.stp", true);
printf("model = %d \n", model);

Please, share if you have success with this change.


 


Edit:


 


There is an error in your RunHMTclString arguments, also used \\ in the #granite\step, remember that \ is a escape sequence., try added an extra \



hm_api->RunHMTclString ("*feinputwithdata2 #granite\\step E:/WAP09Celsius1_Lucian/Verformungsmodell/99_Daten_CATPart/00_Werkstueck_eingriff.stp 1 0 -0.01 0 0 1 1 1 0");

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...