TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Andrea on March 10, 2009, 02:57:22 PM
-
Hi all,
I have experimented something..
It seem to work for all command...
but not Publish.
someone can tell me the problem ?
thanks.
-
If you wish to make the publish command unavailable just dump the arx file that defines it.
(if (member "acpublish.arx" (arx))
(arxunload "acpublish.arx")
)
If that doesn't suit your purposes, undefine only if it is loaded.
/guess (didn't try it myself)
Update, try this:
(if (null (member "acpublish.arx" (arx)))
(arload "acpublish.arx")
)
(command ".undefine" "._publish")
-
Thanks Michael.
didn't think about that..
code revised.
(if (member "acpublish.arx" (arx))
(arxunload "acpublish.arx")
)
(if (and
(null (member "acpublish.arx" (arx)))
(findfile "acpublish.arx")
)
(progn
(ar[color=blue]x[/color]load "acpublish.arx")[color=green];;<- x missing[/color]
(command "._undefine" "_publish")[color=green];; dot at the _publish removed and _underscore at the undefine added ;-)[/color]
)
)
-
You're welcome Andrea, glad it helps in some way.
-
Yes it Help.. thanks.
but the problem still. :-)
When the arx is Unloaded, the publish command still available.
so i need to undefine it and return at the same problem. :-P
-
When the arx is Unloaded, the publish command still available.
That's likely due to an autoloader, e.g. (autoarxload "acpublish" '("publish")), but before we get into thwarting that (I've been biting my tongue so far but now I have to ask) why would you want / need to disable the publish command?
-
in fact...
I'm trying to allow user to have a question before printing with PLOT and PUBLISH
to enter the projectName and some other information..
I have made this with reactor..but the problem is that when the user skip the question the PLOT or PUBLISH command still continue.
;;;;; ;;
;;;;; LOAD REACTEUR ;;
;;;;; ;;
(defun loadCPLOTreactor ()
;On command Start
(if startCPLOT (progn (vlr-remove startCPLOT)(setq startCPLOT nil)))
(setq startCPLOT
(vlr-command-reactor nil '((:vlr-commandWillStart . *startCPLOT*)))
)
;;;;On command Ended
(if endCPLOT (progn (vlr-remove endCPLOT)(setq endCPLOT nil)))
(setq endCPLOT
(vlr-command-reactor nil '((:vlr-commandEnded . *endCPLOT*)))
)
;;On command Cancelled
(if cancelCPLOT (progn (vlr-remove cancelCPLOT)(setq cancelCPLOT nil)))
(setq cancelCPLOT
(vlr-command-reactor nil '((:vlr-commandCancelled . *cancelCPLOT*)))
)
;;On command Failed
(if failedCPLOT (progn (vlr-remove failedCPLOT)(setq failedCPLOT nil)))
(setq failedCPLOT
(vlr-command-reactor nil '((:vlr-commandFailed . *FailedCPLOT*)))
)
)
(loadCPLOTreactor)
(defun *startCPLOT* (calling-reactor startcommandInfo / CPLstart)
(setq CPLstart (car startcommandInfo))
(cond
((eq CPLstart "PLOT") (progn (initdia 0)(CPLOT)) )
((eq CPLstart "PUBLISH") (CPLOT))
)
)
(defun *endCPLOT* (calling-reactor startcommandInfo / CPLend)
(setq CPLend (car startcommandInfo))
(cond
((eq CPLend "PLOT") (CPLfileCreation))
((eq CPLend "PUBLISH") (CPLfileCreation))
)
)
(defun *CancelCPLOT* (calling-reactor startcommandInfo / CPLcancel)
(setq CPLend (car startcommandInfo))
(cond
((eq CPLcancel "PLOT") (cleanCPLOTVar))
((eq CPLcancel "PUBLISH") (cleanCPLOTVar))
)
)
(defun *FailedCPLOT* (calling-reactor startcommandInfo / CPLfailed)
(setq CPLfailed (car startcommandInfo))
(cond
((eq CPLfailed "PLOT") (cleanCPLOTVar))
((eq CPLfailed "PUBLISH") (cleanCPLOTVar))
)
)
so next step....undefine the command and create new one.
(setvar "cmdecho" 0)
(command "_-PLOT")
(if (> (getvar "cmdactive") 0)
(progn
(command)
(command "._undefine" "_PLOT")
(command "._undefine" "_-PLOT")
(command "._undefine" "_PUBLISH")
)
)
(defun c:_PLOT () (progn (setq Tcommand "._PLOT")(CPLOT)))
(defun c:_-PLOT () (progn (setq Tcommand "._-PLOT")(CPLOT)))
(defun c:TRACEUR () (progn (setq Tcommand "._PLOT")(CPLOT)))
(defun c:PUBLISH () (progn (setq Tcommand "._PUBLISH")(CPLOT)))
I was hoping to go with reactor....but can't find a way how to cancel the PLOT if user skip the questions request.
any Help will be appreciated.
thanks.
-
First it has to be loaded or called the command before...
Call the command ARX
Enter an option [?/Load/Unload/Commands/Options]: C
Command Group 'ACAD_PUBLISH'
+PUBLISH, +PUBLISH
-PUBLISH, -PUBLISH
3DDWF, 3DDWF
3DDWFPUBLISH, 3DDWFPUBLISH
PUBLISH, PUBLISH
And use the command group prefix... like:
acad_publish.publish
HTH
-
Thanks Luis.
precious informations here.
but I have the same problem.
-
Another problem..
by selecting few TABS and right-click on it for publish.
This seem to have another Publish command.
because it work even if the Publish command is undefined.
anyone know ? :|
-
noticed on my previous post....
+PUBLISH, +PUBLISH
-PUBLISH, -PUBLISH
note: - I have not tested or tried myself....
-
noticed on my previous post....
+PUBLISH, +PUBLISH
-PUBLISH, -PUBLISH
note: - I have not tested or tried myself....
this allow to get the sheetset DSD file.
-
Another problem..
by selecting few TABS and right-click on it for publish.
This seem to have another Publish command.
because it work even if the Publish command is undefined.
anyone know ? :|
It is the same... command
As I said, this is something I never tried myself... so no idea - sorry
:)
-
Another problem..
by selecting few TABS and right-click on it for publish.
This seem to have another Publish command.
because it work even if the Publish command is undefined.
anyone know ? :|
It is the same... command
As I said, this is something I never tried myself... so no idea - sorry
:)
It's OK Luis...thanks for the Help. :wink:
-
Skinning the cat another way ... is there a change you could modify your work flow to ensure that the information you require is in the drawing (or registry etc. if not drawing centric) long before the plot/publish command is invoked?
-
I have explored all the posibilities....
but still stucked.
The last solution....
to remake all the PRINT function.
nnaahh.....I don't think it's a good idea.
All I need to do is to force user to enter some project info before printing.
-
All I need to do is to force user to enter some project info before printing.
I've always found pain to be an excellent motivator . . .
-
to adjust our publish command, I just modified it so it is called by entering pub, our modification was simple as I am only makeing sure SDI is set to 0 before the regular publish command is used.
On that note, this is possibly the reason I get command unknown when I attempt to undefine and redefine the block editor command. But 2010 ships in a little over a week so I wont need to redefine block editor as a workaround any more.