How to remove yellow color

How to remove yellow color

Anonymous
Not applicable
812 Views
12 Replies
Message 1 of 13

How to remove yellow color

Anonymous
Not applicable
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
813 Views
12 Replies
Replies (12)
Message 2 of 13

Anonymous
Not applicable
The yellow highlight is the debugger showing you where an error occurred.
Because the layout doesn't exist, that statement will cause an error.

The Debug toolbar has a Reset button on it, to stop the execution of the
code.

--
R. Robert Bell


"Adesu" wrote in message
news:[email protected]...
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
Message 3 of 13

Anonymous
Not applicable
Hi Bell,thanks for your input info.

"R. Robert Bell" wrote in message
news:[email protected]...
The yellow highlight is the debugger showing you where an error occurred.
Because the layout doesn't exist, that statement will cause an error.

The Debug toolbar has a Reset button on it, to stop the execution of the
code.

--
R. Robert Bell


"Adesu" wrote in message
news:[email protected]...
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
Message 4 of 13

Anonymous
Not applicable
Hi Bell or others,
I just tested a code to create a line,like this below,and then as "mfauxock"
tutorial I follow it
Tools >select a file > run
after that display alert box and on "Drawline"display highlight with blue
color,and so it's said "Compile error: Expected Function or Variable",then
click Ok,at the code "Public Sub Drawline()" also display highlight yellow
color.
My question is how to revised this code?

[code]
Public Sub Drawline()
Dim lineobj As AcadLine
Dim StartPoint(0 To 2) As Double
Dim EndPoint(0 To 2) As Double

'Define startpoint the line point
StartPoint(0) = 0: StartPoint(1) = 0: StartPoint(2) = 0
'Define endpoint the line point
EndPoint(0) = 10: EndPoint(1) = 10: EndPoint(2) = 0

'Create a line in model space
Set lineobj = ThisDrawing.ModelSpace.AddLine(StartPoint, EndPoint)
ThisDrawing.SaveAs Drawline.dwg
End Sub
[/code]


"R. Robert Bell" wrote in message
news:[email protected]...
The yellow highlight is the debugger showing you where an error occurred.
Because the layout doesn't exist, that statement will cause an error.

The Debug toolbar has a Reset button on it, to stop the execution of the
code.

--
R. Robert Bell


"Adesu" wrote in message
news:[email protected]...
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
Message 5 of 13

Anonymous
Not applicable
ThisDrawing.SaveAs "Drawline.dwg"
You must enclose strings in double quotes. By not doing so VBA thinks that
you are trying to get the .dwg property or method of the Drawline function
which doesn't exist.

"Adesu" wrote in message
news:[email protected]...
[code]
Public Sub Drawline()
Dim lineobj As AcadLine
Dim StartPoint(0 To 2) As Double
Dim EndPoint(0 To 2) As Double

'Define startpoint the line point
StartPoint(0) = 0: StartPoint(1) = 0: StartPoint(2) = 0
'Define endpoint the line point
EndPoint(0) = 10: EndPoint(1) = 10: EndPoint(2) = 0

'Create a line in model space
Set lineobj = ThisDrawing.ModelSpace.AddLine(StartPoint, EndPoint)
ThisDrawing.SaveAs Drawline.dwg
End Sub
[/code]


"R. Robert Bell" wrote in message
news:[email protected]...
The yellow highlight is the debugger showing you where an error occurred.
Because the layout doesn't exist, that statement will cause an error.

The Debug toolbar has a Reset button on it, to stop the execution of the
code.

--
R. Robert Bell


"Adesu" wrote in message
news:[email protected]...
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
Message 6 of 13

Anonymous
Not applicable
Hi Jeff,it's great worked,thanks.
And how if we want to execute in command prompt,is'it possible?
as like Autolisp , only just type "what your have code" and then hit enter.

"Jeff Mishler" wrote in message
news:[email protected]...
ThisDrawing.SaveAs "Drawline.dwg"
You must enclose strings in double quotes. By not doing so VBA thinks that
you are trying to get the .dwg property or method of the Drawline function
which doesn't exist.

"Adesu" wrote in message
news:[email protected]...
[code]
Public Sub Drawline()
Dim lineobj As AcadLine
Dim StartPoint(0 To 2) As Double
Dim EndPoint(0 To 2) As Double

'Define startpoint the line point
StartPoint(0) = 0: StartPoint(1) = 0: StartPoint(2) = 0
'Define endpoint the line point
EndPoint(0) = 10: EndPoint(1) = 10: EndPoint(2) = 0

'Create a line in model space
Set lineobj = ThisDrawing.ModelSpace.AddLine(StartPoint, EndPoint)
ThisDrawing.SaveAs Drawline.dwg
End Sub
[/code]


"R. Robert Bell" wrote in message
news:[email protected]...
The yellow highlight is the debugger showing you where an error occurred.
Because the layout doesn't exist, that statement will cause an error.

The Debug toolbar has a Reset button on it, to stop the execution of the
code.

--
R. Robert Bell


"Adesu" wrote in message
news:[email protected]...
I just this code from "How to make a layout active,reply by R.Robert Bell,at
6/23/2004",and then tested it,but in VBA editor window ,display the yellow
color.
I really don't know how to remove it and what happened,would you inform to
me,to guide me on true way.
Thanks for your suggest and your help.

Sub Test()
ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Item("Layout3")
End Sub

note; my layout only there are "layout1,layout2"
0 Likes
Message 7 of 13

Anonymous
Not applicable
I think, you can creat button and use macro, assign value button is funtion.

Maybe that is another way use.
0 Likes
Message 8 of 13

Anonymous
Not applicable
Hi chubby667,
No, I 'm will not creating a button to execute a VB,it's too far solution
for me,I'm still beginner,knowledge in VBA = 0.

wrote in message news:[email protected]...
I think, you can creat button and use macro, assign value button is funtion.

Maybe that is another way use.
0 Likes
Message 9 of 13

Anonymous
Not applicable
You can try:
^C^C_-vbarun;(name macro)
0 Likes
Message 10 of 13

Anonymous
Not applicable
Do you mean like this
Command: (^C^C_-vbarun; "Add Point.dvd")
It's got trouble !!

wrote in message news:[email protected]...
You can try:
^C^C_-vbarun;(name macro)
0 Likes
Message 11 of 13

Anonymous
Not applicable
No, it is funtion of button.
If from commandline:
command:-vbarun
command:macro
Try it:
0 Likes
Message 12 of 13

Anonymous
Not applicable
Ya.. it's ok,but very different with autolisp.
thanks.
wrote in message news:[email protected]...
No, it is funtion of button.
If from commandline:
command:-vbarun
command:macro
Try it:
0 Likes
Message 13 of 13

Anonymous
Not applicable
No problem.
See you.

Chubby
0 Likes