Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MAP shortestpath problem (VBA+VLisp)

0 REPLIES 0
Reply
Message 1 of 1
Anonymous
160 Views, 0 Replies

MAP shortestpath problem (VBA+VLisp)

This message is posted to disscusion groups: autodesk.autocad.customization,
autodesk.autocad.customization.vba

VERSIONS: Map4 locked; Map 4 unlocked; Map5.
PLATFORMS: Win95, Win98, NT4, Win2000
API: VBA, VLisp

PROBLEM:
I have implemented three MAP trace functions for retrieving shortest paths
from a previously created and opened topology.
The functions are compiled in a VLX and use the exposed AutoLISP MAP trace
functions.
Two of my functions initialize and kill the trace model.
The third function performs the following:
1) runs a shortest path trace
2) scans the path to get a list of links(edges) of the resulting trace
3) converts the list to a Variant for VB (the Variant contains an array of
vlax-vbdouble)
4) the variant is saved in a AutoLISP variable
4) returns "1" or "nil"

My VLisp functions are utilized from VB using the VLAX wrapper (by Frank
Oquendo, see www.acadx.com).
My VLisp functions are called by evaluating a "(function_name) " lisp
expression. If successful they return "1".
My VBA procedure after creating a trace model does a number of loops with
the following steps:
1) Call my VLISP function for the shortest path trace
2) retrieve Variant from autolisp symbol
3) retrieve individual ID-s from Variant (which is an array of doubles)
4) create a new polyline using ID-s (before tracing, I link ObjectIDs with
TPM_IDs of the topology)
5) add Object Data to the new polyline

The procedure works fine on small problems, but after running a couple of
hundred traces
(I need the procedure to run up to the 20 thousand range) it crashes.
The usual error is a memory access error causing a violation of reserved
space, which of course crashes Acad.
If the VBA editor is open, in some of the runs, the debugger will stop on a
" VLF.Item("eval").funcall(sym)" expression.
If "continue" is available within the VBA debugger, using it will finish the
procedure with success.
When this error occurs, I get a message "Expression error: to few arguments"
in the ACAD command prompt.

I would like some help on this matter. Also I need pointers and opinions
concerning my alternatives.
Up to this moment, I have been considering two possible solutions:
a) switch to ADSRX (ADS implementation of the topology functions in MAP) in
conjunction with ObjectARX
b) code my own trace functions
Since both solutions are more than time consuming (a have knowledge of C but
not of C++, VC & MFC)
is there any way out of this problem?

Thankful in advance,
Zlatko Zmijarevic


______________________________________
Zlatko Zmijarevic
Department of Power Systems
Faculty of electrical engineering and computing
University of Zagreb, Croatia
Tel: (385) 1 6129 693
Fax: (385) 1 6129 890
Email: zlatko.zmijarevic@fer.hr
URL: http://www.fer.hr/~zmija/
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost