not to show the Boundary Creation dialog box

not to show the Boundary Creation dialog box

Anonymous
Not applicable
899 Views
16 Replies
Message 1 of 17

not to show the Boundary Creation dialog box

Anonymous
Not applicable
hi,

l like use boundary command without showing the Boundary Creation dialog
box .

instead input the next command to select point ,ect,for in one word i want
to do the

whole in vba sendcommand ,

thanks
0 Likes
900 Views
16 Replies
Replies (16)
Message 2 of 17

Anonymous
Not applicable
I wrote this to create a boundary from a point passed to it. It returns a pline if created, nothing if not.

Public Function Boundary(ByVal XYpoint As Variant) As AcadLWPolyline

Dim PrevTotal As Long
Dim XYstring As String
Dim CurrentSpace As AcadBlock
Dim Plinetype As Integer
Dim Osmode As Integer
Dim Autosnap As Integer
Dim NoMutt As Integer

With ThisDrawing
Set CurrentSpace = IIf(.ActiveSpace = acModelSpace, .ModelSpace, .PaperSpace)
.Regen acActiveViewport
PrevTotal = CurrentSpace.Count
XYstring = CStr(XYpoint(0)) & "," & CStr(XYpoint(1))

Plinetype = .GetVariable("PLINETYPE")
Osmode = .GetVariable("OSMODE")
Autosnap = .GetVariable("AUTOSNAP")
NoMutt = .GetVariable("NOMUTT")

.SetVariable "PLINETYPE", 1
.SetVariable "OSMODE", 1
.SetVariable "AUTOSNAP", 0
.SetVariable "NOMUTT", 1

.SendCommand "._-boundary _a _b _e _i _n _+X _o _p _x" & vbCr & _
XYstring & vbCr & vbCr

.SetVariable "PLINETYPE", Plinetype
.SetVariable "OSMODE", Osmode
.SetVariable "AUTOSNAP", Autosnap
.SetVariable "NOMUTT", NoMutt

'If successful, return the last (new) entity
With CurrentSpace
If .Count > PrevTotal Then
Set Boundary = .Item(.Count - 1)
End If
End With
End With
End Function
0 Likes
Message 3 of 17

Anonymous
Not applicable
Lanny I've changed this line

XYstring = CStr(XYpoint(0)) & "," & CStr(XYpoint(1))

on:

XYstring = Replace(CStr(XYpoint(0)), ",", ".", 1, -1) & "," & _
Replace(CStr(XYpoint(1)), ",", ".", 1, -1)

Now this works like a charm for me
Thanks for nice code example

Regards,

Fatty

~'J'~
0 Likes
Message 4 of 17

Anonymous
Not applicable
Thank you all,Lanny and Fatty,

I learned so much from you,thanks a lot,

a happy new year to you Lanny and Fatty,

thanks,


wrote in message news:5450472@discussion.autodesk.com...
Lanny I've changed this line

XYstring = CStr(XYpoint(0)) & "," & CStr(XYpoint(1))

on:

XYstring = Replace(CStr(XYpoint(0)), ",", ".", 1, -1) & "," & _
Replace(CStr(XYpoint(1)), ",", ".", 1, -1)

Now this works like a charm for me
Thanks for nice code example

Regards,

Fatty

~'J'~
0 Likes
Message 5 of 17

Anonymous
Not applicable
Wish you in the New Year all the best too
Happy computing,

~'J'~
0 Likes
Message 6 of 17

Anonymous
Not applicable
thanks again
i tried your sub,sometimes Boundary is not closed. message occurs,
i dont know why,for i repeat the same operation in cad via Boundary dialog
box,
the failed objects are ok,
why,
sendcommand boundary dosnt work as Boundary dialog box does for us ,enhhhh

Young man
****************************************
wrote in message news:5450344@discussion.autodesk.com...
I wrote this to create a boundary from a point passed to it. It returns a
pline if created, nothing if not.

Public Function Boundary(ByVal XYpoint As Variant) As AcadLWPolyline

Dim PrevTotal As Long
Dim XYstring As String
Dim CurrentSpace As AcadBlock
Dim Plinetype As Integer
Dim Osmode As Integer
Dim Autosnap As Integer
Dim NoMutt As Integer

With ThisDrawing
Set CurrentSpace = IIf(.ActiveSpace = acModelSpace, .ModelSpace,
.PaperSpace)
.Regen acActiveViewport
PrevTotal = CurrentSpace.Count
XYstring = CStr(XYpoint(0)) & "," & CStr(XYpoint(1))

Plinetype = .GetVariable("PLINETYPE")
Osmode = .GetVariable("OSMODE")
Autosnap = .GetVariable("AUTOSNAP")
NoMutt = .GetVariable("NOMUTT")

.SetVariable "PLINETYPE", 1
.SetVariable "OSMODE", 1
.SetVariable "AUTOSNAP", 0
.SetVariable "NOMUTT", 1

.SendCommand "._-boundary _a _b _e _i _n _+X _o _p _x" & vbCr & _
XYstring & vbCr & vbCr

.SetVariable "PLINETYPE", Plinetype
.SetVariable "OSMODE", Osmode
.SetVariable "AUTOSNAP", Autosnap
.SetVariable "NOMUTT", NoMutt

'If successful, return the last (new) entity
With CurrentSpace
If .Count > PrevTotal Then
Set Boundary = .Item(.Count - 1)
End If
End With
End With
End Function
0 Likes
Message 7 of 17

Anonymous
Not applicable
See in Help

HPGAPTOL System Variable

Type: Real
Saved in: Registry
Initial value: 0

Treats a set of objects that almost enclose an area as a closed hatch boundary. The default value, 0, specifies that the objects enclose the area, with no gaps. Enter a value, in drawing units, from 0 to 5000 to set the maximum size of gaps that can be ignored when the objects serve as a hatch boundary.

Hth

~'J'~
0 Likes
Message 8 of 17

Anonymous
Not applicable
Thanks for your quick answer
i am using 2000i,and i failed to find your HPGAPTOL System Variable ,
would you please give me some further advice,
thanks again
-------------------------------

wrote in message news:5451025@discussion.autodesk.com...
See in Help

HPGAPTOL System Variable

Type: Real
Saved in: Registry
Initial value: 0

Treats a set of objects that almost enclose an area as a closed hatch
boundary. The default value, 0, specifies that the objects enclose the area,
with no gaps. Enter a value, in drawing units, from 0 to 5000 to set the
maximum size of gaps that can be ignored when the objects serve as a hatch
boundary.

Hth

~'J'~
0 Likes
Message 9 of 17

Anonymous
Not applicable
Sorry, that was my mistake
This routine will be works with closed
polylines only 😞

~'J'~
0 Likes
Message 10 of 17

Anonymous
Not applicable
no,thax,
but i dont know why for instance,the scope which is good to make a boundary
failed
to make one in the routine,
maybe there is a setting as you said just now ,



wrote in message news:5451034@discussion.autodesk.com...
Sorry, that was my mistake
This routine will be works with closed
polylines only 😞

~'J'~
0 Likes
Message 11 of 17

Anonymous
Not applicable
but i dont know why for instance,the scope which is good to make a boundary
via dialog box ,failed
to make one in the routine,
maybe there is a setting as you said just now ,



"youngman" wrote in message
news:5451040@discussion.autodesk.com...
no,thax,


wrote in message news:5451034@discussion.autodesk.com...
Sorry, that was my mistake
This routine will be works with closed
polylines only 😞

~'J'~
0 Likes
Message 12 of 17

Anonymous
Not applicable
I have not found an answer for now
Just an idea only...
Create 'noplot' layer and enclose boundary
by drawing line on this layer

~'J'~
0 Likes
Message 13 of 17

Anonymous
Not applicable
thax after all,
what you said seems to be a way to solve this issue,but when boundary is
make up of
several objects, say several lines ,polylines, it is almost impossile to
find simply where the unclosed part is ,
dont you think so,
yes of course it is not just a vba problem ,i cannnot find simply where the
unclosed part is in
cad itself when the error message pops up,saying the what you selected is
not closed.......
best regards,


wrote in message news:5451042@discussion.autodesk.com...
I have not found an answer for now
Just an idea only...
Create 'noplot' layer and enclose boundary
by drawing line on this layer

~'J'~
0 Likes
Message 14 of 17

Anonymous
Not applicable
Anyway, if I would be a found the solution,
I 'll say you about

~'J'~
0 Likes
Message 15 of 17

Anonymous
Not applicable
Thanks a lot.
Have a nice day,

wrote in message news:5451059@discussion.autodesk.com...
Anyway, if I would be a found the solution,
I 'll say you about

~'J'~
0 Likes
Message 16 of 17

Anonymous
Not applicable
no problem ,
i found the system variable as you said in 2005
there isnt in 2000i,
thank you Fatty


wrote in message news:5451034@discussion.autodesk.com...
Sorry, that was my mistake
This routine will be works with closed
polylines only 😞

~'J'~
0 Likes
Message 17 of 17

Anonymous
Not applicable
I'd like to use some of these ideas. Could someone please tell me what
_a _b _e _i _n _+X _o _p _x" & vbCr & _
XYstring & vbCr & vbCr
means? I take it that these are input parameters used by the bpoly form. But, what are each of these parameters? In lieu of the easy answer, perhaps someone could direct me to a resource where I could find what these parameters are?
Thanks
0 Likes