sendcommand string problem

sendcommand string problem

Anonymous
Not applicable
283 Views
2 Replies
Message 1 of 3

sendcommand string problem

Anonymous
Not applicable
Hi all,

I'm using the sendcommand to run the pedit from the command line. It looks
like it will work except I have one problem. I am selecting the object by
specifying a point. I have the x,y coordinates of the first point of the
polyline I want selected as a string in the form:

mypoint = "15,10"

so when I do my sendcommand I send:

ThisDrawing.SendCommand "_pedit" & vbCr & mypoint & vbCr & "j" & vbCr &
"all" & vbCr & vbCr

I think this should work but what happens is this:

________________________________________________________________
Command: _pedit
Select polyline: Select polyline: 492729.63,
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
Select polyline: 5518783.13
Select polyline: j
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
Select polyline: all
Enter an option [Open/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
gen/Undo]:
________________________________________________________________

Somehow a carriage return is executed when the comma between the x and y
coordinate is encountered.

Does anyone know why this is happening?

TIA

--
Scott Nelson

Technical Director
Scenery Plastics Inc.
www.sceneryplastics.com
0 Likes
284 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
If you have the handle of the polyline, then use something
like this:

SendCommand "_pedit (handent " & Chr(34) & Polyline.Handle & Chr(34) & ") "

Avoid using point selection as much as possible, because it
can be influenced by any number of factors, and easily result
in selecting the wrong object, or no object.

Scott wrote:
>
> Hi all,
>
> I'm using the sendcommand to run the pedit from the command line. It looks
> like it will work except I have one problem. I am selecting the object by
> specifying a point. I have the x,y coordinates of the first point of the
> polyline I want selected as a string in the form:
>
> mypoint = "15,10"
>
> so when I do my sendcommand I send:
>
> ThisDrawing.SendCommand "_pedit" & vbCr & mypoint & vbCr & "j" & vbCr &
> "all" & vbCr & vbCr
>
> I think this should work but what happens is this:
>
> ________________________________________________________________
> Command: _pedit
> Select polyline: Select polyline: 492729.63,
> *Invalid selection*
> Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
> Select polyline: 5518783.13
> Select polyline: j
> *Invalid selection*
> Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
> Select polyline: all
> Enter an option [Open/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
> gen/Undo]:
> ________________________________________________________________
>
> Somehow a carriage return is executed when the comma between the x and y
> coordinate is encountered.
>
> Does anyone know why this is happening?
>
> TIA
>
> --
> Scott Nelson
>
> Technical Director
> Scenery Plastics Inc.
> www.sceneryplastics.com

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://www.caddzone.com */
/*********************************************************/
0 Likes
Message 3 of 3

Anonymous
Not applicable
Scott,

Check if the following sample code is of any help

pt = ThisDrawing.Utility.GetPoint(, "Pick: ")
ThisDrawing.SendCommand ".point " & pt(0) & "," & pt(1) & vbCr

Cheers,
Thilak

Scott wrote in message
news:[email protected]...
> Hi all,
>
> I'm using the sendcommand to run the pedit from the command line. It
looks
> like it will work except I have one problem. I am selecting the object by
> specifying a point. I have the x,y coordinates of the first point of the
> polyline I want selected as a string in the form:
>
> mypoint = "15,10"
>
> so when I do my sendcommand I send:
>
> ThisDrawing.SendCommand "_pedit" & vbCr & mypoint & vbCr & "j" & vbCr &
> "all" & vbCr & vbCr
>
> I think this should work but what happens is this:
>
> ________________________________________________________________
> Command: _pedit
> Select polyline: Select polyline: 492729.63,
> *Invalid selection*
> Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
> Select polyline: 5518783.13
> Select polyline: j
> *Invalid selection*
> Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon
> Select polyline: all
> Enter an option [Open/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
> gen/Undo]:
> ________________________________________________________________
>
> Somehow a carriage return is executed when the comma between the x and y
> coordinate is encountered.
>
> Does anyone know why this is happening?
>
> TIA
>
> --
> Scott Nelson
>
> Technical Director
> Scenery Plastics Inc.
> www.sceneryplastics.com
>
0 Likes