Community
PowerShape and PowerMill API Forum
Welcome to Autodesk’s PowerShape and PowerMill API Forums. Share your knowledge, ask questions, and explore popular API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

VB - Get the selected z-depth

5 REPLIES 5
Reply
Message 1 of 6
manuel.matheis
395 Views, 5 Replies

VB - Get the selected z-depth

Hello,

 

I want to get the z-depth.

The function of the button in my plugin should be the same as the button in the toolpath. (see Attachment)

 

I can use this command 

 

pm.Execute("MODE OBTAIN ZHEIGHT """)

 

then I can select the z-depth in Powermill

 

and than i don´t know, how i get the value into a textbox.

 

Can someone help me?
thanks in advance

 

 

 

 

 

 

 

5 REPLIES 5
Message 2 of 6
icse
in reply to: manuel.matheis

this sets the min value textbox:

pm.Execute("MODE OBTAIN ZHEIGHT 'ZRange.Minimum.Value'")
Message 3 of 6
luc_ponsaerts
in reply to: icse

Hi,

 

I used the mode command to hide input windows as in MODE NOGUI ....

MODE OBTAIN ... is new for me.

There are more MODE commands, where can I find the necessary documentation/information?

Didn't find anything in Help/parameters/reference, mor in the PM Macro manual.

Message 4 of 6
manuel.matheis
in reply to: icse

yes, but I want to geht the parameter $ZRange.Minimum.Value in my application.

 

How I get the parameter after I pick the depth?

Message 5 of 6
icse
in reply to: manuel.matheis

this function should return the value of this textblock as a string:

pm.ExecuteEx("PRINT PAR $ZRange.Minimum.Value").ToString();

 

Message 6 of 6
manuel.matheis
in reply to: icse

Thank you, but my problem is different.

 

after the command---powermill.Execute("MODE OBTAIN ZHEIGHT 'ZRange.Minimum.Value'")---

I have to select the depth in Powermill, so my application has to wait until I have selected the model.

 

I have currently solved this with a loop, but I think there is a better solution!

Here is my code:

        Dim depth As String
        Dim depth_old As String
        depth = powermill.ExecuteEx("PRINT PAR $ZRange.Minimum.Value").ToString
        depth_old = depth

        powermill.ExecuteEx("MODE OBTAIN ZHEIGHT 'ZRange.Minimum.Value'")

        'powermil. ?????waiting for selection?????

        While depth = depth_old
            depth = powermill.ExecuteEx("PRINT PAR $ZRange.Minimum.Value").ToString
        End While

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums