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.

SYS Functions

Started by SilentType, April 30, 2011, 01:54:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SilentType

Hi, I haven't posted for a while but can anyone tell me if there is an update SYS and SYS$ function list since V17?

I am mainly after the sys functions in relation to dimensions which primarily changed on release to V18 (since I am attempting to transition all of my macros from V17 to V20).

Is there a sys function now for the Dimension Text Offset?

ST

Rob S


Not all have sys functions, but you CAN set them all with basiccad.  If you open our dss05 macro found here

http://forum.designcad.com/index.php?topic=1047.0

you can see the methods we used to set all of these parameters within this macro.

You can also do it by recording a macro, where you draw a dimension using the desired parameters.  That will record the method for doing it.

Using the Null parameter allows you to then run this macro without actually drawing anything.
User since forever

SilentType

Thanks Rob. Your answer is as I expected, but not what I hoped to hear. I am familiar enough with the workaround, but maybe if I explain my gripe then maybe Droll Troll or the programmers might pick up on it and resolve it. Or more realistically someone else might have another way around and resolve the problem.

It seems to me that the programming team are either taking shortcuts or are not conforming to the original intent of the software. My understanding would be that every attribute or every property of lines, layers, text and dimensions, should be stored in the SYS functions. Obviously somewhere under the hood they are keeping the state, so why not make them all available through the SYS and SYS$ functions? Otherwise what was the purpose of exposing the SYS functions?

Why does this matter? There are other ways to change stuff ie via >null you might be thinking.

Well, I am a believer in returning DesignCad to it's pre-macro running state. That is, I wish to return all dimension settings to what they were before the user ran the macro. Obviously, I need to force the dimensional settings so that the macro automated drawing comes out exactly as expected everytime - irrespective of what settings the user had before.

The problem that I can't yet get my head around, and hope someone can provide an easy resolution, is how do I return DesignCad to its original state when I don't have the power to record it in the first place?

If I can't write DimTextOffset = sys(?) then how do I get it?

Just in case it's still not obvious as to why I want to do this, I'll give an example that I can do.
-------------------------------------------
User launches macro while in Layer 32, with a specific colour, and who really knows what line properties they've been using.

My macro records the current state of these.

'Record current user state to enable return at end of macro
   OrigRed = SYS(300)      'Record the intial red colour
   OrigGreen = SYS(301)   'Record the intial green colour
   OrigBlue = SYS(302)      'Record the intial blue colour

   OrigLayr = SYS(3)      'Record the intial layer
   OrigLType = SYS(4)      'Record the intial Line Type
   OrigLScale = SYS(5)      'Record the intial Line Scale
   OrigLWidth = SYS(6)      'Record the intial Line Width

I now go off and then draw on some other layer (eg layer 25) and happily change the colours, line styles and widths.

Upon exit I return it to how it was before.
   SYS(3) = OrigLayr
   '-----CHANGE LINE STYLE, SCALE, WIDTH BACK
   SYS(4) = OrigLType
   SYS(5) = OrigLScale
   SYS(6) = OrigLWidth

   '-----CHANGE COLOUR BACK TO STARTING COLOUR
   SYS(300) = OrigRed
   SYS(301) = OrigGreen
   SYS(302) = OrigBlue

This means when the user returns they can continue working in Layer 32 with all the attributes that they had before. There is nothing worse than having the user waste time going in an updating all the settings before they can draw their next line.
-------------------------------------------

Hopefully now my dilemma is now clear.

My list of properties that I cannot record to enable reinstating seems to be getting longer.
- Whether a double line is saving as a Double Line, Plane, or Line.
- Pullout arrow size (which is independant of the Dimension Arrow Size).
And now that I've moved to V20
- Dimension Text Offset.
- Whether a dimension is associated or not.
- Whether a second arrow head is enabled.
- Whether the dimension has units.
And the list goes on, but it is only so many that upset the users.

Sorry for the long post - thanks to those that made it to the end. Any suggestions?

ST

bdeck

Hello ST,

Try the query and change parameters.

You can archive the properties of each dimension and text entity prior to changing them, then you can set them back.

Dont forget the update command.

BD

SilentType

Thanks bdeck,

In order to query an entity I'd have to have one selected wouldn't I? So I'd have to physically draw a dimension in order to get the current setting, delete it, and then do my macro, before resetting.

Seems achievable but a hard way of doing it - I hope it doesn't come down to that.

ST

bdeck

#5
Quote from: SilentType on May 01, 2011, 01:34:35 AM
So I'd have to physically draw a dimension in order to get the current setting, delete it, and then do my macro, before resetting.

Hi ST,

The macro could draw the dim, query its properites by its entity number (sys(9)), then delete it using EraseLast. No need to ever select it.

At the end of the macro, draw a Null dim using the archived properties to return DC to the proper settings. No need to delete it.

Certainly not as pretty as sys functions, but just as effective.

BD

dcadRob

dbeck,
Does query give you EVERY property of an entity?

bdeck

Quote from: dcadRob on May 01, 2011, 06:22:16 AM
Does query give you EVERY property of an entity?

O.K. Rob, you caught me speeding.

Dunno the answer, but I doubt it.

Correction: "Just as effective for the parameters it changes."

For the record, I also would like to see all paramenters exposed, preferably as sys vars.

bd

JJG

the method presented by bdeck, of creating an entity, read properties and erase it, is good.
If "Query" does not recover all the parameters, the other method, consisting in using the "finger infobox" then Getselect and valid sys() functions  , I presented in the topic http://forum.designcad.com/index.php?topic=26.msg19979#new  , may do it too.