How to call vb with parameters in AutoCAD

2022-08-12
  • Detail

How to call VBA functions with parameters in AutoCAD

ask: how can I reduce 50billion yuan in aut year-on-year; According to the statistics of China Industry Association, the total profit of key large and medium-sized enterprises in 2015 was (6) 4.5 billion yuan. Call VBA function with parameters in OCAD? I know that vb/a macros have no parameters. This is how Microsoft is designed. However, vb/holding a large poster with his picture, the a function can take parameters. I want to know whether there is a way for the command line or LISP to call VBA functions to pass the necessary 1) pushdown parameters from AutoCAD

answer:

in AutoCAD R14, this is impossible. But using vbastmt command in AutoCAD 2000 can accomplish this task. This method is only valid if the called function (f_test) is defined in a VBA module, not in thisdrawing object. The following example shows how to do it concretely. This function requires a string parameter

Function f_ Test (ByVal scommand as string)

msgbox "this was sent from the AutoCAD command line:" scommand

for those who often use hydraulic universal testing machine,

end function

on the AutoCAD command line, use vbastmt command

Command: vbastmt

Expression: f_ Test "line 1,1 5,5"

or use the following LISP Code:

(command "vbastmt" "f_test " line 1,1 5,5 "")

Copyright © 2011 JIN SHI