Site Logo
Site Logo
 
It is currently Sun Apr 02, 2017 10:21 pm

All times are UTC [ DST ]




Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: get max z height of solid in PowerSHAPE
PostPosted: Wed Jan 20, 2016 8:56 pm 
Offline
New User
New User

Joined: Fri Jan 28, 2011 8:27 pm
Posts: 6
how can i use the boundingbox property of pssolid to get the max z height of all the selected solids?

thanks

john


Top
 Profile  
 
 Post subject: Re: get max z height of solid in PowerSHAPE
PostPosted: Thu Jan 21, 2016 12:38 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
Hi John

Currently the only way to do this would be with a LINQ function such as:
Code:
var maxZ = _powerSHAPE.ActiveModel.SelectedItems.OrderByDescending(x => x.BoundingBox.MaxZ).First();

This would have performance issues though depending on how many items are selected. I will look to add a BoundingBoxOfSelection property to the PSModel for a future version of CSC.

Luke


Top
 Profile  
 
 Post subject: Re: get max z height of solid in PowerSHAPE
PostPosted: Thu Jan 21, 2016 8:20 pm 
Offline
New User
New User

Joined: Fri Jan 28, 2011 8:27 pm
Posts: 6
luke thanks , i wrote it like this:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim i As Integer
Dim zh As String


For i = 5 To 31
PS.Execute("TOOLBAR LEVEL ON " & i)
PS.Execute("SELECTall")
zh = PS.Evaluate("selection.size.z")


PS.Execute("file export '" & "Z:\2015\spring jon\circle 08\mill\" & zh & "'")
PS.Execute("TOOLBAR LEVEL OFF " & i)
Next i


End Sub


thanks

john


Top
 Profile  
 
 Post subject: Re: get max z height of solid in PowerSHAPE
PostPosted: Thu Jan 21, 2016 9:54 pm 
Offline
DELCAM Staff
DELCAM Staff

Joined: Tue Mar 17, 2009 2:30 pm
Posts: 108
Hi John

The idea of CSC is you can get away from doing Execute and ExecuteEx.

You could do this a bit with something like:

Code:
For i = 5 To 31
activeModel.Levels(i).IsActive = True
activeModel.SelectAll()
zh = PS.Evaluate("selection.size.z")

activeModel.Export(new File("Z:\2015\spring jon\circle 08\mill\" & zh))
activeModel.Levels(i).IsActive = False
Next i


Having said that, I am not sure how that code gives you what you asked for initially.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB