| Author |
Message |
dhorton
Guest
|
Posted:
Fri Dec 31, 2004 7:15 pm Post subject:
Creating Dialog box for attribute updating |
|
|
Hello,
Re: Creating Dialog box for attribute updating
I have written a lisp routine that will alter a specific tag value of a specific block name to a predetermined value. This is all hard-coded into the lisp. (To alter the value, tag and/or block to be updated, one has to edit the lisp program).
To progress things further I would like the user to be able to call up a dialog box, tick whether the change is to be applied globally to a drawing or to a selection; choose a particular attribute block name from a dropdown; subsequently choose a tag name from a dropdown; enter the new value; then click OK!
How do I go about it???
For the dropdowns....the values can be coded in. i.e the routine doesn't have to 'find' block names and tags.
I appreciate anyones help.
Thanks!
Dom
|
|
| Back to top |
|
 |
Laurie Comerford
Guest
|
Posted:
Mon Jan 03, 2005 6:50 am Post subject:
Re: Creating Dialog box for attribute updating |
|
|
Hi,
If you have never used DCL to create a dialog box, you will find it easer to
move the whole project to VBA, do the dialog box there and recode the block
editing you have in VBA.
--
Regards,
Laurie Comerford
www.cadapps.com.au
"dhorton" <nospam@address.withheld> wrote in message
news:5296852.1104502547276.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Hello,
Re: Creating Dialog box for attribute updating
I have written a lisp routine that will alter a specific tag value of a
specific block name to a predetermined value. This is all hard-coded into
the lisp. (To alter the value, tag and/or block to be updated, one has to
edit the lisp program).
To progress things further I would like the user to be able to call up a
dialog box, tick whether the change is to be applied globally to a drawing
or to a selection; choose a particular attribute block name from a
dropdown; subsequently choose a tag name from a dropdown; enter the new
value; then click OK!
How do I go about it???
For the dropdowns....the values can be coded in. i.e the routine doesn't
have to 'find' block names and tags.
I appreciate anyones help.
Thanks!
Dom |
|
|
| Back to top |
|
 |
dhorton
Guest
|
Posted:
Tue Jan 04, 2005 2:37 pm Post subject:
Re: Creating Dialog box for attribute updating |
|
|
Laurie,
Thanks for your reply.
I thought that using VBA might be the better method but having no experience of it I think i'll struggle! Although, if you are aware of any good reference points i'm more that willing to learn. Also, if you know of any good DCL learning resources i'd appreciate it.
Thanks,
Dom
|
|
| Back to top |
|
 |
Laurie Comerford
Guest
|
Posted:
Tue Jan 04, 2005 3:28 pm Post subject:
Re: Creating Dialog box for attribute updating |
|
|
Hi Dom,
VBA is far easier to learn and to debug than lisp. Also the help files are
better and the sample code is far more extensive.
DCL files are so difficult that the only people who use them are those have
been through a learning exercise akin to learning to write Chinese with
Japanese characters.
As a single example I wrote a program in lisp and the dialog box took me
about 4 days. The coding and debugging of the program about another week.
Later I discovered an error in the output and spent about 2 hours trying to
find where it occurred in the lisp code.
I gave up and completely rewrote the program in VBA. The dialog box took
about 30 minutes and the whole of the code about a day. I was asked to
change its layout to match another program's interface. It took about 2
minutes to do this. In DCL it would have taken me another 3 days.
--
Laurie Comerford
CADApps
www.cadapps.com.au
"dhorton" <nospam@address.withheld> wrote in message
news:31270004.1104831506934.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Laurie,
Thanks for your reply.
I thought that using VBA might be the better method but having no
experience of it I think i'll struggle! Although, if you are aware of any |
good reference points i'm more that willing to learn. Also, if you know of
any good DCL learning resources i'd appreciate it.
|
|
| Back to top |
|
 |
dhorton
Guest
|
Posted:
Tue Jan 04, 2005 3:51 pm Post subject:
Re: Creating Dialog box for attribute updating |
|
|
Hi,
I get the gist!
As I am still relatively new to Lisp programming would it be advisable to plough on with Lisp and get a good grounding in it or to move across to VBA? Can you recommend a decent ACAD VBA book and/or website?
cheers
Dom |
|
| Back to top |
|
 |
Laurie Comerford
Guest
|
Posted:
Wed Jan 05, 2005 1:35 am Post subject:
Re: Creating Dialog box for attribute updating |
|
|
Hi,
The only knowledge of lisp which is now useful for me is that I use it to
call my VBA functions in an MNL file.
At install I write the program location to the registry
The program files have names like:
DuplicatePoints-2004-v2.dvb
DuplicatePoints-2005-v2.dvb
DuplicatePoints-C3D2005-v2.dvb
The following extract of one of the MNL files shows what I believe are the
essentials of lisp to call VBA.
;//
;// AutoCAD menu file - C:\Program
Files\CADApps\LandToolbox\Programs\LandToolbox.mnl
;// 7 April 2004 Modified to allow use with any version of Land desktop
;// 7 Jun 2003 Modified to hide data other than the menu command itself
(vl-load-com)
(setq sCurProduct (vlax-product-key))
; The following lines do a check of version and set the appropriate DB and
VLX sub variables
(if (vl-string-search "ACAD-208" sCurProduct)(setq sLTBSubProgramName
"-2004-v2.dvb!"))
(if (vl-string-search "ACAD-218" sCurProduct)(setq sLTBSubProgramName
"-2004-v2.dvb!"))
(if (vl-string-search "ACAD-308" sCurProduct)(setq sLTBSubProgramName
"-2005-v2.dvb!"))
(if (vl-string-search "ACAD-300" sCurProduct)(setq sLTBSubProgramName
"-C3D2005-v2.dvb!"))
(setq sLandToolboxPath
(strcat
(vl-registry-read
"HKEY_LOCAL_MACHINE\\Software\\CADApps\\LandToolbox" "ProgramPath")
"\\"
)
)
(setq sLandToolboxHelpPath
(vl-registry-read
"HKEY_LOCAL_MACHINE\\Software\\CADApps\\LandToolbox" "HelpPath")
)
(defun CADApps_BlankCommandLine (spString)
(setq n (strlen spString))
(repeat n(prompt(chr 8)))
(repeat n(prompt(chr 32)))
(princ)
) ; CADApps_BlankCommandLine
(defun C:CA_LandToolBoxHelp ()
(Command "Browser" (strcat sLandToolboxHelpPath "\\LT_HelpIndex.htm"))
(CADApps_BlankCommandLine (strcat sLandToolboxHelpPath
"\\LT_HelpIndex.htm"))
) ; end Defun CA_LandToolBoxHelp
(defun C:CA_DuplicatePoints ()
(setq sLandToolboxFunction (strcat sLandToolboxPath "DuplicatePoints"
sLTBSubProgramName "DuplicatePoints"))
(vl-vbarun sLandToolboxFunction)
(CADApps_BlankCommandLine sLandToolboxFunction)
) ; end Defun CA_DuplicatePoints
(defun C:CA_DuplicatePointsAbout ()
(setq sLandToolboxFunction (strcat sLandToolboxPath "DuplicatePoints"
sLTBSubProgramName "DuplicatePointsAbout"))
(vl-vbarun sLandToolboxFunction)
(CADApps_BlankCommandLine sLandToolboxFunction)
) ; end Defun CA_DuplicatePointsAbout
etc for each command you wish to define.
When these commands are called from a menu, you can press <Enter> to restart
the command which is one of the conveniences of this system.
Very occasionally to get information I type things at the keyboard like:
(set y (entget (car (entsel)))
or
(/ 23.45 6 5425)
!sLandToolboxPath (I use this while testing if the menu command aren't
working)
But lack of the understanding to do this keyboard work would not really be
prohibitive to working in AutoCAD
--
Laurie Comerford
CADApps
www.cadapps.com.au
"dhorton" <nospam@address.withheld> wrote in message
news:7791468.1104835905915.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Hi,
I get the gist!
As I am still relatively new to Lisp programming would it be advisable to
plough on with Lisp and get a good grounding in it or to move across to VBA? |
Can you recommend a decent ACAD VBA book and/or website?
|
|
| Back to top |
|
 |
|
|
|
|