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
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" <pa...@prisma-meten.nl> wrote in message
news:f0c6...@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
>
"pschut" <pa...@prisma-meten.nl> wrote in message news:f0c6...@WebX.maYIadrTaRb...
chuckmy 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
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" <pa...@prisma-meten.nl> wrote in message
news:f0c6...@WebX.maYIadrTaRb...