Importing Reference Model from Macro

Importing Reference Model from Macro

Anonymous
Not applicable
972 Views
5 Replies
Message 1 of 6

Importing Reference Model from Macro

Anonymous
Not applicable

Greetings All,

 

I am having some troubles Importing a Reference Model in PowerMill 2019 from Macro.

 

The Macro Line used is Below

 

IMPORT REFERENCE_SURFACES "C:\Current Jobs\Shop Fixtures and 3R\3Rmadilla_Ref_model2.dgk"

 

I have also used it with no success in the Command Window.

The program responds "Error Reading Model, Translator Error"

 

However if I simply import it from the menu FILE/IMPORT/MODEL then I have no difficulty.

If I use the macro command to import an earlier version of this file I have no difficulties.

How do I go about tracking down this problem?

I have run File Doctor on the problematic model... no errors reported.

 

Joe7

0 Likes
Accepted solutions (1)
973 Views
5 Replies
Replies (5)
Message 2 of 6

design
Enthusiast
Enthusiast

try this:

 

STRING Filename = ''
$Filename = FILESELECT "Please select a model file" "*.dgk" "C:\Current Jobs\Shop Fixtures and 3R\."
IMPORT REFERENCE_SURFACES $Filename

 

 

Vilchez
Message 3 of 6

Anonymous
Not applicable

Thank you!  Hmmn...Very interesting. Why does it work?

 

I need to load three reference models and then toggle them visible/hidden during macro progress depending on user selection options.

Is it possible to do the above without user input?

0 Likes
Message 4 of 6

Anonymous
Not applicable

Well it seems all my troubles were not actually errors in the file in so much as Errors in my macro that seems to

have discombobulated PowerMill.  So after a few restarts, and a reboot for good measure... I switched to triangles.

 

IMPORT REFERENCE_SURFACES "C:\Current Jobs\Shop Fixtures and 3R\3Rmadilla_triangles3.dmt"

 

And I guess my goal of hiding versions of 3 reference models will not be possible... so they will need to be loaded in on demand.

0 Likes
Message 5 of 6

LasseFred
Collaborator
Collaborator
Accepted solution

something like that:

STRING Filename = ""
$Filename = FILESELECT "Please select a model file" "*.dgk" "C:\Current Jobs\Shop Fixtures and 3R\."
IMPORT REFERENCE_SURFACES
$Filename

bool carryon = 0

string yesnoprompt = "Do you want to blank some models?"
$carryon = query $yesnoprompt
IF $carryon == 1 {

STRING $Model_name = ""
$Model_name = INPUT ENTITY MODEL "Please select that model you want to blank."

EDIT MODEL $Model_name SELECT ALL
BLANK SELECTED

}

 

or:

You can make levels for your models.

 

bool carryon = 0

string yesnoprompt = "Do you want to make some levels for your models?"
$carryon = query $yesnoprompt
IF $carryon == 1 {

STRING $Model_name = ""
$Model_name = INPUT ENTITY MODEL "Please select that model you want to blank."

REAL levelname= INPUT "Rename level"
EDIT MODEL $Model_name SELECT ALL
CREATE LEVEL ; LEVEL
RENAME Level ; $levelname

EDIT LEVEL ; ACQUIRE SELECTED
}

 

i have not tested it....

______________________
Lasse F.
0 Likes
Message 6 of 6

Anonymous
Not applicable

Very cool. thank you!

0 Likes