Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No (command) allowed in acaddoc.lsp file

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
301 Views, 6 Replies

No (command) allowed in acaddoc.lsp file

There is an "issue" in ADT2006 and ADT2007, that if you use a (command) in a
start up file (such as ACADDOC.LSP) is can disable many of the Express Tool
commands (no one at Autodesk will say why, just that it is too complicated
to fix). The issue goes away upon opening a second file. Weird.

Anyway, I have this line of terrible code:
(if (= (tblsearch "style" "romand") nil)
(command "style" "romand" "romand" "" "0.75" "" "" "" "")
)
and am clueless on how to re-write is without using (command) - yes I'm just
a hacker when it comes to code and I don't know vlisp or VBA.
Anyone want to rewrite this properly (probably takes about 3 seconds,
right?).

--
Regards,
---------------
Reid M. Addis
Registered Architect
Architectural Applications Specialist
Granary Associates
411 North 20th Street
Philadelphia, PA 19130
Ph. 215-665-7056
email: addis@granaryassoc.com
6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: Anonymous

Something like this should do the trick.

(if (not (tblsearch "style" "romand"))
(entmake
'((0 . "STYLE")
(100 . "AcDbSymbolTableRecord")
(100 . "AcDbTextStyleTableRecord")
(2 . "romand")
(70 . 0)
(40 . 0.0)
(41 . 0.75)
(50 . 0.0)
(71 . 0)
(42 . 0.09375)
(3 . "romand.shx")
)
)
)

--
Autodesk Discussion Group Facilitator



"Reid M. Addis" wrote in message
news:5129916@discussion.autodesk.com...

Anyway, I have this line of terrible code:
(if (= (tblsearch "style" "romand") nil)
(command "style" "romand" "romand" "" "0.75" "" "" "" "")
)

Anyone want to rewrite this properly (probably takes about 3 seconds,
right?).
Message 3 of 7
Anonymous
in reply to: Anonymous

Why not just execute calls to command from
within an S::STARTUP function?

As far as it being 'too complicated to fix', that
is a bunch of rubbish.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Reid M. Addis" wrote in message news:5129916@discussion.autodesk.com...
There is an "issue" in ADT2006 and ADT2007, that if you use a (command) in a
start up file (such as ACADDOC.LSP) is can disable many of the Express Tool
commands (no one at Autodesk will say why, just that it is too complicated
to fix). The issue goes away upon opening a second file. Weird.

Anyway, I have this line of terrible code:
(if (= (tblsearch "style" "romand") nil)
(command "style" "romand" "romand" "" "0.75" "" "" "" "")
)
and am clueless on how to re-write is without using (command) - yes I'm just
a hacker when it comes to code and I don't know vlisp or VBA.
Anyone want to rewrite this properly (probably takes about 3 seconds,
right?).

--
Regards,
---------------
Reid M. Addis
Registered Architect
Architectural Applications Specialist
Granary Associates
411 North 20th Street
Philadelphia, PA 19130
Ph. 215-665-7056
email: addis@granaryassoc.com
Message 4 of 7
Anonymous
in reply to: Anonymous

I have never had problems with command in the acaddoc.lsp, and I have always used Tonys method of (s::startup)
I would guess the problems arise because the s::startup runs after acad initializes.
Running the code outside the s::startup function conflicts with something express is not finished with.
So stick to S::STARTUP and it should work

Reid M. Addis
|>There is an "issue" in ADT2006 and ADT2007, that if you use a (command) in a
|>start up file (such as ACADDOC.LSP) is can disable many of the Express Tool
|>commands (no one at Autodesk will say why, just that it is too complicated
|>to fix). The issue goes away upon opening a second file. Weird.
|>
|>Anyway, I have this line of terrible code:
|>(if (= (tblsearch "style" "romand") nil)
|> (command "style" "romand" "romand" "" "0.75" "" "" "" "")
|>)
|>and am clueless on how to re-write is without using (command) - yes I'm just
|>a hacker when it comes to code and I don't know vlisp or VBA.
|>Anyone want to rewrite this properly (probably takes about 3 seconds,
|>right?).
James Maeding
Civil Engineer and Programmer
jmaeding - athunsaker - com
Message 5 of 7
Anonymous
in reply to: Anonymous

This is particular to ADT, and may not effect AutoCAD only.
It IS a real problem however. Thanks everyone.

--
Regards,
---------------
Reid M. Addis
Registered Architect
Architectural Applications Specialist
Granary Associates
411 North 20th Street
Philadelphia, PA 19130
Ph. 215-665-7056
email: addis@granaryassoc.com
Message 6 of 7
Anonymous
in reply to: Anonymous

Reid,

I recently found this problem as well, with running (command) functions within
acaddoc.lsp.

The problem I ran up against was that I could not enter a viewport in a layout
by double-clicking inside of it.

To test this, I made a template with a layout, and put a Viewport in it. Using
that when creating a new drawing, with (command) inside of the acaddoc.lsp, and
I was unable to enter the viewport by dbl-click. Hitting the MSpace button does
work.

Curiously, starting a second drawing using the same template, and everything is
OK.

FWIW, the (command) calls were made inside of S::STARTUP. When these are
commented out, everything runs fine.

Matt
mstachoni@comcast.net
mstachoni@bhhtait.com



On Tue, 4 Apr 2006 15:17:54 +0000, Reid M. Addis
wrote:

>This is particular to ADT, and may not effect AutoCAD only.
>It IS a real problem however. Thanks everyone.
Message 7 of 7
Anonymous
in reply to: Anonymous

On Mon, 3 Apr 2006 14:27:23 +0000, Tony Tanzillo
wrote:

>Why not just execute calls to command from
>within an S::STARTUP function?

Because issuing a (command) inside (s::startup) still causes the problem. It
also occurs if you call a function that itself calls (command). I'm on ADT 2006.

I haven't heard of the Express Tools propbnlem (I rarely use them), but the
problem I've run up against is that if you use (command) in your (s::startup)
code, you cannot dbl-click to get inside of a Mview viewport.

Like Reid says, if only happens in the FIRST drawing in a session. Subsequent
drawings in a SDI=0 environment work fine.

In a perhaps related issue, I've found that I cannot enable the Visibility
parameter in a Dynamic Block in the first drawing in an autoCAD session.
Clicking on the VB triangle icon simply issues repeats the last command issued.

Matt
mstachoni@comcast.net
mstachoni@bhhtait.com



>--
>http://www.caddzone.com
>
>AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
>http://www.acadxtabs.com
>
>"Reid M. Addis" wrote in message news:5129916@discussion.autodesk.com...
>There is an "issue" in ADT2006 and ADT2007, that if you use a (command) in a
>start up file (such as ACADDOC.LSP) is can disable many of the Express Tool
>commands (no one at Autodesk will say why, just that it is too complicated
>to fix). The issue goes away upon opening a second file. Weird.
>
>Anyway, I have this line of terrible code:
>(if (= (tblsearch "style" "romand") nil)
> (command "style" "romand" "romand" "" "0.75" "" "" "" "")
>)
>and am clueless on how to re-write is without using (command) - yes I'm just
>a hacker when it comes to code and I don't know vlisp or VBA.
>Anyone want to rewrite this properly (probably takes about 3 seconds,
>right?).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost