Jump to content

How do I have a command causes a function to


WPerciful

Recommended Posts

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)
)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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") .

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...