Jump to content
WPerciful

How do I have a command causes a function to

Recommended Posts

WPerciful

I wrote a sub-routine to update drawing borders. There is a command in CADWorx called IGO which creates isometric drawings. I wanted have this command call my function which updates the borders. But my code doesn't work.

 

(defun c:igo ( / )
(setvar "cmdecho" 0)
(command "igo")
(setvar "cmdecho" 1)
(runisoborderupdate)
(princ)
)

Share this post


Link to post
Share on other sites
MSasu

First, by using the same name for your function, you may over-write the definition from that said CADWorx.

Calling of that IGO command in AutoLISP will be infuenced by how was defined - if come from an AutoLISP pack, the should use:

[color=red][s](command "igo")[/s][/color] (c:igo)

Share this post


Link to post
Share on other sites
WPerciful
First, by using the same name for your function, you may over-write the definition from that said CADWorx.

Calling of that IGO command in AutoLISP will be infuenced by how was defined - if come from an AutoLISP pack, the should use:

[color=red][s](command "igo")[/s][/color] (c:igo)

 

I'm not sure I understand what you mean. Because when I attempt to test what you are saying with say the line command :

 

(c:line)

 

Doesn't work. But this does:

 

(command "line")

 

I am trying to run the IGO command so that I have it run my update function.

Share this post


Link to post
Share on other sites
Tharwat

If the command that you want to run is a Lisp function , you should call it like this (c:igo) but if it is built-in command , you should call it with the command function

(command "line") .

Share this post


Link to post
Share on other sites
WPerciful
If the command that you want to run is a Lisp function , you should call it like this (c:igo) but if it is built-in command , you should call it with the command function

(command "line") .

 

Thank you. While (c:igo) didn't work I tried (c:isogenout) and that did it. :D

 

But it still pops up the dialog box. I tried (c:-isogenout) and (c:_isogenout) but that didn't work.

 

Any thoughts?

Share this post


Link to post
Share on other sites
Tharwat

What does this isogenout mean ?

Is it a Lisp function or a command call in another Autodesk programs ?

 

More info is needed .

Share this post


Link to post
Share on other sites
WPerciful

ISOGenOut is a command in CADWorx Plant (more info here). CADWorx Plant is basically add on software to AutoCAD. The ISOGenOut creates isometric drawing of a 3D model created in CADWorx Plant.

When you run ISOGenOut, it brings up a “Select ISOGEN Style” dialog box, which allows you to select different styles in which the output can be created.

Then it prompts the user to select objects. Then it creates isometric drawings of the model.

I wrote code to update the titleblocks of the drawings it creates, but I’d like to have the ISOGenOut command trigger my code that I wrote. That way the user only has to execute one command instep of a second step.

Share this post


Link to post
Share on other sites
MSasu

Since you was able to call it that way, this means that it is in fact an AutoLISP function; there is no way to prevent the dialog box to appear other than contacting the programmers of said tool to request them to include a switch for it in their code.

Share this post


Link to post
Share on other sites
WPerciful

Is there a way that once that lisp has finished to have it run my routine?

Share this post


Link to post
Share on other sites
MSasu

One solution will be to use a reactor, although I'm not sure if you can attach one to a third-part command.

Share this post


Link to post
Share on other sites
WPerciful

I know the folder that the new created files are saved into. Could I use a reactor to trigger my code if file has been created and saved into that folder?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...