Page 1 of 1

Macros' from autoCAD

Posted: Sat Nov 10, 2001 11:23 am
by cwp
Hey there .. How would u be?

I have this problem. In AutoCAD you can use the backslash as a user input command within a macro. Is this still possible on IntelliCAD. I'm having problems with it in one of my macro's.

Posted: Sun Nov 11, 2001 5:50 pm
by tooldesigner
Is this the only Macro that uses the backslash ?

Posted: Mon Nov 12, 2001 3:55 am
by Steve N
Does your problem macro have pauses (\) for attributes? I have found problems in this area.


Steve N

Posted: Tue Nov 13, 2001 1:12 am
by cwp
No I severall that use this backslash. it inly stops for user input not attributes

Thanks

Posted: Tue Nov 13, 2001 5:24 am
by Steve N
CW

If you wish to email a copy of one of your problem macros I will offer any help I can.

Steve N

Posted: Tue Nov 13, 2001 9:37 pm
by tooldesigner
CWP

I would like to take a look at it too if you don't mind. I will try to help if I can.

Posted: Wed Nov 14, 2001 1:41 am
by cwp
Hello

Tnkas for the replys one of them is as follows: ^C^Clayer;set;ar7;;colour;blue;linetype;set;bylayer;;-style;ductno;;100;;;;;text;\\\layer;set;ar2;;colour;yellow;linetype;set;bylayer;

Posted: Wed Nov 14, 2001 1:45 am
by cwp
Hello

Tnkas for the replys one of them is as follows: ^C^Clayer;set;ar7;;colour;blue;linetype;set;bylayer;;-style;ductno;;100;;;;;text;\\\layer;set;ar2;;colour;yellow;linetype;set;bylayer;

Posted: Wed Nov 14, 2001 2:17 pm
by Steve N
CW
NOT MUCH PROGRESS YET

I've looked at your macro and found a couple of MINOR problems,
i/ Icad appears to only recognise COLOR not COLOUR.
ii/ I have added an extra ";" highlighted with {} prior to calling the "text" command.

Otherwise all looked ok, however your tripple \\\ was ignored, your original problem! I then broke your complete macro into several smaller single command macros to try each in turn, and then re-assembled your macro command by command. At the stage shown below all worked as expected!
But as soon as I added the next stage the \\\ was again ignored??????

^C^C^Clayer;set;ar7;;color;blue;linetype;set;bylayer;;-style;ductno;;100;;;;;{;}text;\\\

You could consider splitting your macros, but this would only be a work around
I came across this problem a few weeks back when I imported a number of existing MNU files containing toolbars with macros for blocks with attributes, which I believed was resolved by setting Attdia to 1, however the problem has returned, I will continue trying to resolve this and post again later.

Steve N

Posted: Wed Nov 14, 2001 5:05 pm
by avaernes
I believe "\\\" is part of a DIESEL expression (enhanced macro
language for Autocad). I don't think it is supported in Intellicad. You
must use lisp to accomplish user input the way you want. The lisp below is a sample code for the example you provided. Copy and paste
it to your Icad.lsp file, reload Icad.lsp.


(defun setlay_type (textlayer textcolor textlinetype oldlayer oldcolor oldlinetype style font size / string pos)
(command "Layer" "Make" textlayer "Color" textcolor "" "Ltype" textlinetype "" "")
(command "-Style" style font size "" "" "" "" "")
(setq pos (getpoint "\nText: <Start Point>: "))
(setq string (getstring "\nText: "))
(command "Text" pos "" string )
(command "Layer" "Make"oldlayer "Color" oldcolor "" "Ltype"oldlinetype "" "")
)


Next, replace your macro expression with this one:

(setlay_type "ar7" "5" "CONTINUOUS" "ar2" "2" "CONTINUOUS" "ductno" "txt" "100")

No ^C^C before the expression.

Each argument to this expression can be any relevant one . Unlike the macro, you can probably use the same lisp function several times, for various layers or text sizes.

I had to change the following to make it work - appearently something specific with my installation if Steve's macro works:
Compared to your macro, I had to input a string for the font (in this case, "txt"). Also changed "Linetype" to "Ltype".

I changed "Set" layer to "Make" layer - does the same, but does not require the layer to be already defined. I also don't think it is correct to set the linetype to "Bylayer" since it is part of the layer definition itself.

Posted: Wed Nov 14, 2001 9:18 pm
by cwp
Hey there thanks for the reply.. Looks like I need to use lisp instead of macro. I thing I have to ask do you guys find that the regeneration and general speed of intelliCAd is extremely slower that ACAD or is this some other sort of problem?? I really want to use IntelliCAD so I hoping that its a user problem. By the way I want to thatk you guys for the effort you put into my macro problem I can't really do more than thank you. So thanks heaps

Posted: Thu Nov 15, 2001 2:19 am
by Steve N
Avaernes

You state
"I believe "\\\" is part of a DIESEL expression (enhanced macro
language for Autocad). I don't think it is supported in Intellicad."

Why does the macro:-
^C^C^Clayer;set;ar7;;color;blue;linetype;set;bylayer;;-style;ductno;;100;;;;;{;}text;\\\
work? and pause for 3 individual user inputs????

Are you saying that ANY "\" will be ignored?

Steve N

Posted: Thu Nov 15, 2001 3:07 am
by cwp
Thats about the size of my problems at the moment..

Posted: Thu Nov 15, 2001 6:25 am
by avaernes
Steve,

My error.
Actually I made the assumption about the DIESEL thing from your posting, and from looking at a few DIESEL expressions which use the backslash character. Appearently I did not read your post well enough. I understood at first that the "\" character was rejected/ignored under ALL conditions. Re-reading your post I see this is not the case. Ok, this is not DIESEL. There seems to be a problem with the way Intellicad traces a macro expression - no pause/resume available.
My conclusion is still the same: Lisp

Posted: Thu Nov 15, 2001 2:01 pm
by Steve N
Just to confuse the situation even further, look at the following macro:-

^c^c^cinsert;600;\\;;leader;\end;\;;n

This inserts a standard symbol 600.dwg (weld symbol)
at a user selected insertion point, and of a user selected X scale.
Y scale and rotation are defaults.

600.dwg has 1 attribute and at this point the system displays the Attribute Edit Dialoge Box,
(System Variable "Attdia" is set to 1)

I can insert the value as required and select ok, and the macro continues as normal.
Now the macro works fine, I'm happy.
All simple stuff,
However I originally had an extra "\" prior to "Leader"
System Variable "Attdia" was set to 0 and all attribute values entered
from the command line.
This would not work, any movement of the mouse was taken as
the current "paused" user input. Only with the help from the guys
at Cadopia plus hours from myself was the above solution acheived.

Hence when I first saw CW's original post my question re: attributes

Question.
Is this problem a BUG?