Peer Review?

Peer Review?

Anonymous
Not applicable
349 Views
7 Replies
Message 1 of 8

Peer Review?

Anonymous
Not applicable
I just thought I would throw this out there and see if anyone bites.

I am still pretty much of a rank amateur programmer, as some of you can no
doubt tell by some of the code and questions I have posted in the past. I
have no formal training to speak of (unless you want to count a couple of
community college courses in Pascal and Cobol). Lets just say I know enough
to be dangerous.

At any rate I have taken on a few projects that in all truth are not quite
in line with my skill level. Not for money mind you. I write this stuff
for my own use. I wouldn't dream of asking anyone to pay for the programs I
put out. Besides, most of my programs use at least one component that was
written by someone else and freely distributed for noncommercial use (Thanks
Frank, Randall , Tony, Jacob and others).

What I am wondering is if we, as a community, would be interested in setting
up some sort of a peer review system. We could post our source code, and
hopefully somebody with more experience and skill would look it over and
make suggestions.

I am not holding out a tremendous amount of hope, because I have posted a
couple of projects in the past in an attempt to solicit comments without
getting a single response. Like I said, I just thought I would throw it out
there. I'm sure there are others among you who would love to have their
code reviewed by someone with more experience than themselves. I just don't
know if there are any people who would be willing to do the reviewing. My
own ability to review other people's code is limited by my lack of
experience and training, but I would be willing to help those with less
skill than myself if I can count on reciprocation from those with more skill
than myself.

I know this basically amounts to asking for a free programming education,
but based on the generosity I have seen from some people in this group in
the past, there may be enough support to make it work.

Thanks,
Chuck Gabriel
0 Likes
350 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
why not chuck is, a good idea can you help me out with this one.


What i'm trying to do is the following:


I have selection set on run time (select on screen fuction)
I select a couple of entities and like you do as a ACAD user you pan and zoom to the next entitie to be selected what happens is, that the previous selection is lost.


pschut
0 Likes
Message 3 of 8

Anonymous
Not applicable
If I could solve your problem, I would be a master indeed. Several people
in this group have been trying to find a workaround for this problem to no
avail. The SelectOnScreen method has a bug that causes it to fail if a
toolbar button is pressed. Someone please correct me if I am remembering
incorrectly here.

The only solution I have seen thus far was provided by Tony Tanzillo. His
AcadX.arx has the capability to register VBA macros as native AutoCAD
commands, which purportedly will eliminate the toolbar bug. Tony has posted
several examples demonstrating the use of this feature in his program. If
you have difficulty locating one, post back here and I will attempt to dig
one up for you. AcadX.arx is available from Tony's web site,
www.caddzone.com.

Happy Hunting,
Chuck


"pschut" wrote in message
news:f0c67ae.0@WebX.maYIadrTaRb...
> why not chuck is, a good idea can you help me out with this one.
>
> What i'm trying to do is the following:
>
>
> I have selection set on run time (select on screen fuction)
> I select a couple of entities and like you do as a ACAD user you pan and
zoom to the next entitie to be selected what happens is, that the previous
selection is lost.
>
>
> pschut
>
0 Likes
Message 4 of 8

Anonymous
Not applicable
chuck

my question is one step furter then the answer you gave me
the answer to that question is using ERROR TRAPPING like


.....ON ERROR GOTO ERRORHANDLER

ERRORHANDLER

here the code to go back to the selec on screen function


but this is not the problem

the problem is that as soon as i have a selection set and i have already some entities in it shown highlighted, from there i press a button (PAN FOR EXAMPLE) i loose everthing in the selection, but because i use a ERROR TRAP in it the function comes back to me but it is empty.

pschut
0 Likes
Message 5 of 8

Anonymous
Not applicable

These are the steps  ...
 
1)
trap the 'right click' and 'begincommand' events
 
2) create rtn (A)
and zero selection set 1 (S1) ,
    create a loop inside rtn
(A) that calls rtn (B)
 
3) in rtn (B) ask for selection set 2 (S2) ,
if a 'begin command' or
    'right click' event was hit, then
dump all preselected entities to selection set (S1)
 
4) return to
rtn (A), if the trapped 'begin command' is *cancel*, then
   
all is selected - exit rtn, else highlight all entities in (S1) and
call
    rtn (B) again (that is, goto step 3 and keep
repeating).
 
The best way to learn is to figure it out yourself, as
long as your
given hints when you reach dead ends.
 
If this
develops into a common request, i'll post the
code.
 
 Gadski.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
chuck

my question is one step furter then the answer you gave me
the answer
to that question is using ERROR TRAPPING like


.....ON ERROR GOTO ERRORHANDLER

ERRORHANDLER

here the code to go back to the selec on screen function


but this is not the problem

the problem is that as soon as i have a selection set and i have already
some entities in it shown highlighted, from there i press a button (PAN FOR
EXAMPLE) i loose everthing in the selection, but because i use a ERROR TRAP in
it the function comes back to me but it is empty.

pschut

0 Likes
Message 6 of 8

Anonymous
Not applicable
I believe I understood your question correctly. I have dealt with the exact
situation you are describing.

Randall Rath provided some code in his A.C.A.D. newsletter a while back that
was supposed to resolve the problem, but to my knowledge it did not quite
hit the mark. Randall, please correct me if I am mistaken. The code didn't
work for me, but I may have implemented it incorrectly.

The following is an excerpt from the newsletter:


....... many other developers have found that when a user clicks
the Zoom,Pan, or, for that matter, any tool bar button during the
interactive methods:

GetEntity
GetPoint
GetSubEntity
SelectOnScreen

The button click kills the currently running VBA procedure. We have
provided several solid work-a-rounds for the Get methods of the Utility
object, but the SelectOnScreen method posed a bit more of a challenge.
In the end we developed this little bit of code:

Private Declare Function GetCursor Lib "user32" () As Long

Public Function SelectOnScreenFix() As AcadSelectionSet
Dim objSelSet As AcadSelectionSet
Dim objSelCol As AcadSelectionSets
On Error GoTo Err_Control
Set objSelCol = ThisDrawing.SelectionSets
For Each objSelSet In objSelCol
If objSelSet.Name = "sos" Then
objSelCol.Item("sos").Delete
Exit For
End If
Next
Set objSelSet = objSelCol.Add("sos")
Do
objSelSet.SelectOnScreen
Loop Until GetCursor = 0
Set SelectOnScreenFix = objSelSet
Exit_Here:
Exit Function
Err_Control:
Select Case Err.Number
Case Else
MsgBox Err.Description
End Select
End Function

and released it in the September 4, 2001 issue of A Code A Day. Brian
had a bit of trouble integrating it, and in the end found that every
time the user clicked one of those tool bar buttons, all previously
selected items where dropped and the SelectOnScreen method started a
fresh count. In other words, until you are done selecting, the items
you have selected are not part of the selection set.
Hummm..
Ok, try this:

----------------------- About this code ------------------------

Development Time: 14 minutes (new)
Category: AutoCAD "Feature" fix
Developed By: Ralph, The Wonder Llama
Developer comments: Experimental Code - test before production use!

----------------------------------------------------------------

Private Declare Function GetCursor Lib "user32" () As Long

Public Function SelectOnScreenFix() As AcadSelectionSet
Dim objSelSet As AcadSelectionSet
Dim objSelCol As AcadSelectionSets
Dim intCnt As Integer
Dim objEnts() As AcadEntity
On Error GoTo Err_Control
Set objSelCol = ThisDrawing.SelectionSets
For Each objSelSet In objSelCol
If objSelSet.Name = "sos" Then
objSelCol.Item("sos").Delete
Exit For
End If
Next
Set objSelSet = objSelCol.Add("sos")
Do
objSelSet.SelectOnScreen
If GetCursor = 2822 Then
For intCnt = 0 To ThisDrawing.ActiveSelectionSet.Count - 1
ReDim Preserve objEnts(intCnt)
Set objEnts(intCnt) = ThisDrawing.ActiveSelectionSet(intCnt)
Next intCnt
objSelSet.AddItems objEnts
End If
Loop Until GetCursor = 0
Set SelectOnScreenFix = objSelSet
Exit_Here:
Exit Function
Err_Control:
Select Case Err.Number
Case Else
MsgBox Err.Description
End Select
End Function

At any rate, you may take some solace from the fact that some of the top
minds in the field are working on the problem.

As for Gadski's solution, I didn't follow it. That certainly doesn't mean
it won't work, just that I didn't understand it.

Chuck

"pschut" wrote in message
news:f0c67ae.2@WebX.maYIadrTaRb...
> chuck
> my question is one step furter then the answer you gave me
> the answer to that question is using ERROR TRAPPING like
>
>
> .....ON ERROR GOTO ERRORHANDLER
>
> ERRORHANDLER
>
> here the code to go back to the selec on screen function
>
>
> but this is not the problem
>
> the problem is that as soon as i have a selection set and i have already
some entities in it shown highlighted, from there i press a button (PAN FOR
EXAMPLE) i loose everthing in the selection, but because i use a ERROR TRAP
in it the function comes back to me but it is empty.
>
> pschut
>
0 Likes
Message 7 of 8

Anonymous
Not applicable
gadtec,


thanks for your help, gona try it out


pschut
0 Likes
Message 8 of 8

Anonymous
Not applicable
chuck,


thanks for your help this is exactly what i meant.


pschut
0 Likes