Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I have problem with function GetBoundingBox at random DWG blocks. I have random DWG where are all layers visible and this function from some reason returns totally different points for Z coordinates. Does anybody have experience with this? Thank for any advices
Public Sub BBCreateLine() Dim ssFlip As AcadSelectionSet Dim pt1 As Variant Dim pt2 As Variant Set ssFlip = ThisDrawing.SelectionSets.Add("flip") ssFlip.SelectOnScreen GetSSBoundingBox ssFlip, pt1, pt2 ' draw a line from point to point ThisDrawing.ModelSpace.AddLine pt1, pt2 ssFlip.Delete End Sub Public Sub GetSSBoundingBox(ss As AcadSelectionSet, ptMin As Variant, ptMax As Variant) Dim entItem As AcadEntity Dim ptImin As Variant Dim ptImax As Variant Const X = 0 Const Z = 2 ss(0).GetBoundingBox ptMin, ptMax For Each entItem In ss entItem.GetBoundingBox ptImin, ptImax If ptImin(X) < ptMin(X) Then ptMin(X) = ptImin(X) If ptImin(Z) < ptMin(Z) Then ptMin(Z) = ptImin(Z) If ptImax(X) > ptMax(X) Then ptMax(X) = ptImax(X) If ptImax(Z) > ptMax(Z) Then ptMax(Z) = ptImax(Z) Next End Sub
result in DWG
link to test block:
...
Solved! Go to Solution.