News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

layers shortcuts

Started by bobl, July 17, 2014, 02:22:21 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

bobl

#15
I re-entered DC with the right dir as the path for macros under options/options/file locations.
selecting l_dean.d3m via the menu system works
but via the command line still doesn't i.e.
% l_dean 5

I renamed l_dean to z3 to see if another name would work.
In both cases I get a cross hair pop up where I selected the item and one in space.
I have no idea what this is.

BTW even though DC knows the dir for macros i.e. in file locations it still reverts to
C:\Program Files\DesignCAD Pro 2000
when you select the macro execute menu option
I wouldn't have expected this.

Let me see if DC17 does the same.
Back soon!

Bob P

The % key brings up the list of macros, but that is not necessarily what you want.  Just hit the space-bar to open the command line and enter the macro name, then <enter>.  I haven't been following this thread closely, so I'm assuming that l_dean is written to take a number argument.

Lar

I've not been following this thread so this may have already been said:
  You can run regular macros from the command line by typing in its name. If the macro is not in the default folder then type it's path too (may require double quotes). If the macro name has spaces then double quotes are required. The command line list holds about 20 entries (click the down arrow then click the needed entry), even between sessions, so your 20 most often used entries will naturally always be available. I only use about 4 command line commands and once I enter them they are always available until I install a new version.

Lar

bobl

#18
Bob, Lar
I'd just come back to say I tried what I was doing on 3000 and 17 and the same was happening.
No wonder...I was failing on most of the fronts that you mention so...thank you very much for the advice i.e. I really hadn't appreciated that simply calling l_dean.d3m which is just l.d3m which a different path for color.txt wouldn't pop up the same input box that you get when calling it from the menu option i.e I just tried l_dean....wow...that one got me good! So....macros written to be called from the command line shouldn't use GUI features...Is that right?

Bob P

You can create pop-up "menus" in BasiCad, but they require keystroke responses.  The mouse won't work.  See my "view" macros (savl.d3m, hsl.d3m, etc. , which pop up lists of named layer sets for recording or retrieval.

prl

#20
Quote from: Bob P on July 18, 2014, 06:36:47 AM
In fact, many of my macros that work in V15 don't work in V23

BobP, since I run the same code for versions 15 to 24 (yes, there will be one), I've added a top of code check to many routines where there is different variable behavior between versions.  Example:

'Program: dothis.d3m
.
.
gosub GetVersion

if dcver > 15 then
  as = sys(12) 'text size setting for arrows in version 16+
else
  as = 1
endif
.
End

'subroutines follow
GetVersion:
  s$ = sys$(105)
  fmt$ = "%d"
  parse s$, fmt$, dcver
Return

bobl

Thanks Bob...I'll have a look at those.

prl

Quote from: Bob P on July 18, 2014, 04:44:51 AM
Here is the color pallet that I used.  I think that color 7 and another color were exchanged in later DOS versions.

Thanks Bob.  Sam, you could write a simple script to swap colors on a duplicate drawing for those clients that wish to have it their way.   I've done that.  Also, I have a toggle for different background colors because some guys are old school and like black, some guys like white, a few like light gray, some like the SketchUp colors, some like pink, some are just crazy, etc. . . . . . .   I gave up trying to match them years ago. 

bobl

#23
window 7, 40
locate 3, 9
print "centered in the window"
anykey

Here's a test macro called "test_me.d3m"
It runs fine from the menu but not from the command line
i.e. The only thing I get popping up is 2 cross-hairs.
I'm sure it's me.

Edit:
Maybe not i.e.
"test_me" type on the command line doesn't work in 2000 or 3000 but it does in 17
despite all having the path for macro in file locations set to the self same directory.
Does it sound like re-install time?


prl

#24
Quote from: bobl on July 18, 2014, 11:19:27 AM
Here's a test macro called "test_me.d3m"

Did you attach something or is the above the whole thing? 

Edit:  Looks like back in version 10 (2000), you had to type Run first. 

bobl

#25
No that's the whole lot in a file called test_me.d3m.
I just did something "foolproof" to get something/anything up from the command line :)
Thanks for the advice re run....
It doesn't seem to take arguments i.e. just pops up the C:\Program Files\DesignCAD Pro 2000
directory from which you select your macro,
irrespective of which directory you set macro to in file locations :)
Looks like mystery solved so....thank you very much indeed.
To do layers quicker than the eye can see...we're talking 17 then
and I must say that...to me....the change is a very good improvement.
I might stick with 2000 and just use run for now.
Again Thanks.




samdavo

#26
Dean, just playing around (V22.1)

I saved your macro as
test_me1.d3m
test me2.d3m

test_me3.txt, and
test me4.txt
(these last two were sorta by accident lol).

Strangely enough they all work if you use Run Macros (%) - only thing there is that you have to display all files to see the third and fourth options.

As for command line, only
(spacebar)test_me1(enter)   and
(spacebar)"test me2"(enter) work  - just as Lar said above.

As for toolbox icons, 
test_me1   and
test me2   both work.

Moral of the story?
try not to have spaces in macro_names. (and you are obviously onto that) - unless you convert it to a toolbox icon I guess, or run it from (%).

also, lol, if you screw up and accidentally save a macro as a txt file, you can still run it with  % + display all files.
(how's that for rocket science  :) ? )

samdavo

#27
Quote from: samdavo on July 18, 2014, 05:29:15 AM
BobP
I like your macros, but have a question.
you say that
a) savl.d3m saves the current layer state (visibility and editability)
b) rv.d3m retrieves it ( great !)

However, do you really need
c) av.d3m ( add  to savl) and
d) subv.d3m (to subtract from savl) ?

i.e. I would have thought you could change the "layer state" (longhand, or using macros), and simply use/ rewrite savl.d3m to update it to the latest data (?)
BobP
I suspect you missed this post.  I (really) like those macros of yours.
Anyway, unless I'm missing something, I don't see the point of av and subv.
i.e. if you have a "layer edit and visible status" (LEAVS?) that hides layers 1 and 2,
and you change that to hide layers 1, 2 and 3,
(or hide just layer 1 for that matter)
then when you save with savl.d3m, the previous "LEAVS" is updated - and you are even invited to rename it (perfect!) 

Anyway just checking with you to see if there is an advantage to using ad.d3m or subv.d3m?

(maybe that should be the Layer Lock and Look Status LLLS? )

Bob P

Add view allows you to start with the current group of displayed layers, then add another saved layer "group" to what is displayed.  It's like inserting individual component(s) to what you see in order to make a more complete assembly.
Sub view allows you to remove that group of layers to return to the original displayed layer state.

samdavo

#29
ahh 
I find I can save each of the sails of the SOH (for instance) - which could be floors of a building if you prefer (multi-layer drawings each) -
and save each as its own LLLS (layer lock and look status)

and add and subtract them from view and edibility pretty much at will -
great stuff, thanks for setting me straight there.

Question:
Is this an alternative to "Grouped Layers" (which I personally have never considered using)?
- anyway if it is an alternative I would use this in preference to the Layer Dialogue Box, because I prefer macros to clicking "+" signs in Q\Layers. 

PS In my own line of getting bread and butter, "a" would be a piston, and "b" would be a cylinder etc. (2 cents)  -   or (thinking about it)  maybe "p" for piston, "c" for cylinder.  Great stuff.