Author Topic: Undefine Publish Command  (Read 5528 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Undefine Publish Command
« 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.
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Undefine Publish Command
« Reply #1 on: March 10, 2009, 03:10:01 PM »
If you wish to make the publish command unavailable just dump the arx file that defines it.

Code: [Select]
(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:

Code: [Select]
(if (null (member "acpublish.arx" (arx)))
    (arload "acpublish.arx")
)
(command ".undefine" "._publish")
« Last Edit: March 10, 2009, 03:14:21 PM by MP »
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #2 on: March 10, 2009, 03:51:50 PM »
Thanks Michael.

didn't think about that..

code revised.
Code: [Select]
(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]
  )
)

Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Undefine Publish Command
« Reply #3 on: March 10, 2009, 03:55:26 PM »
You're welcome Andrea, glad it helps in some way.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #4 on: March 10, 2009, 04:10:48 PM »
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
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Undefine Publish Command
« Reply #5 on: March 10, 2009, 04:16:10 PM »
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?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #6 on: March 10, 2009, 04:42:29 PM »
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.
Code: [Select]
;;;;; ;;
;;;;; 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.
Code: [Select]

(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.
Keep smile...

Spike Wilbury

  • Guest
Re: Undefine Publish Command
« Reply #7 on: March 10, 2009, 04:44:35 PM »
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

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #8 on: March 10, 2009, 05:25:14 PM »
Thanks Luis.

precious informations here.
but I have the same problem.

« Last Edit: March 10, 2009, 05:47:44 PM by Andrea »
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #9 on: March 10, 2009, 06:16:56 PM »
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 ?  :|




« Last Edit: March 10, 2009, 06:27:01 PM by Andrea »
Keep smile...

Spike Wilbury

  • Guest
Re: Undefine Publish Command
« Reply #10 on: March 10, 2009, 06:29:11 PM »
noticed on my previous post....

Quote
    +PUBLISH, +PUBLISH
    -PUBLISH, -PUBLISH


note: - I have not tested or tried myself....

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #11 on: March 10, 2009, 06:46:29 PM »
noticed on my previous post....

Quote
    +PUBLISH, +PUBLISH
    -PUBLISH, -PUBLISH


note: - I have not tested or tried myself....

this allow to get the sheetset DSD file.
Keep smile...

Spike Wilbury

  • Guest
Re: Undefine Publish Command
« Reply #12 on: March 10, 2009, 07:03:23 PM »
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

:)

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #13 on: March 10, 2009, 07:41:35 PM »
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:
Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Undefine Publish Command
« Reply #14 on: March 10, 2009, 10:11:43 PM »
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?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Undefine Publish Command
« Reply #15 on: March 10, 2009, 10:59:58 PM »
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.
Keep smile...

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Undefine Publish Command
« Reply #16 on: March 11, 2009, 12:10:27 PM »
Quote
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 . . .
James Buzbee
Windows 8

Chris

  • Swamp Rat
  • Posts: 548
Re: Undefine Publish Command
« Reply #17 on: March 13, 2009, 08:46:58 AM »
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.
Christopher T. Cowgill, P.E.
AEC Collection 2020 (C3D)
Win 10