
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Well, I have created a Visual Basic macro that reads filtered info from a range of tables in a Qlikview application database and then it writes a Lisp program. In this table I have coordinates and variable names that will be used many times in this created Lisp program. What I dont know how to do is a function to receive this coordinates and "variable names" and use it as a variable name and not just its content. Well this will be my first function. Why I need to do it is because sometimes this macro is creating a Lisp program with 28 thousand lines, so my idea is to replace this linear code that repeats many commands in a function. So instead repeating command lines I'll call this funcion to reduce the code size inside the Lisp program and make it faster to the Autocad run it.
Examples of some lines that are created by this macro in a linear code:
(setq a1 ' (-477.949 370.679 0))
(setq b1 ' (-477.949 322.249 0))
(command "Line" a1 b1 "")
(setq a1b1_line (entlast))
(setq offpt (osnap a1 "NEA"))
It´s possible to receive a1 as an argument and use it as an variable name.
(defun aCoord (ax ay az variable)
' where ax -477.949 ay 370.679 az0 and variable a1
(setq "variable" (ax ay az))
' I need that the variable received as an argument be replaced by its contents a1, b1, c1, etc...
If someone understand my question and could help me...
Thanks in advance
Solved! Go to Solution.