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.

Auto tolerance dimension problem with <SuffixText

Started by corlett, August 18, 2010, 06:10:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

corlett

Hi

I am writing a basic program to automatically look up and compose toleranced dimensions to British Standard limits and fits.  I have written a lot of simple macros but as an occasion writer I find the syntax difficult.

All is going well but in the >Dimension command neither arguments <PrefixText or <SuffixText seem to work. All other arguments do work.
<Prefix n, works but I have a bunch of suffixes to do to this is a limiting solution.

I have tried the following

>Dimension
{
s$=" H8 "
<SufixText s$

and

<SuffixText " H8 "
}

Any tips?

This is in Designcad v20
I am working with Help file v17 and the latest SDK
I have found "DesignCAD 3D Max 18 BasicCAD Release Notes.pdf"  but contains no real help,
only a possible work around where I place the dimension and then alter the suffix using
Change D_suffix, " H8"

dcadRob

I think that the S$ should be outside of the { brackets. Have you tried using [S$] ( ie. <Suffixtext [S$] ). Do you have <Suffix n within the dimension block? It may be interfering with the Suffixtext.

I'm assuming that the "<SufixText s$" in your post is a typo.

corlett

He nub of the code looks like this:-

s$="  H8 "
p$="Ø"

>Dimension
{
<ToleranceType 2
<ToleranceSize 0.8
<ToleranceHigh +0.029
<ToleranceLow -0.025

<PrefixText p$
<SuffixText [s$]    ' adding random syntax
}


I have also tried this :-
<PrefixText "Ø"
<Suffixtext [" H8 "]

All efforts result in a dimension without Prefix or suffix

Clive

Lar

I've never used this myself in macros but here's what I found out so far:

First you must start a type of dimension command, open the prefix/suffix dialog, click on Custom-1 and enter text to replace it. Do this for the other customs (5 max) and click the save button.

Do this for every type of dimension you require.

Now the syntax in the macro would be as follows:

>Dimension   'specify the type if not a linear dimension
{
'...
<Prefix "1"   '0=none, 1 - 5 for which custom you want
<Suffix "1"
'...
}


Here are the sys functions that you can experiment with. Can't say exactly how they work

PREFIX:
401 - Angular dimension prefix [0-5]
    [0 = None, 1-Custom1, 2=Custom2, etc.]
402 - Linear dimension prefix [0-5]
403 - Radius dimension prefix [0-5]
404 - Diameter dimension prefix [0-5]
405 - Chamfer dimension prefix [0-5]
406 - Coordinate dimension prefix [0-5]
450 - Dimension arc prefix [0-5]
504 - Dimension Baseline prefix [0-5]
514 - Dimension Extended prefix [0-5]
524 - Dimension Distance prefix [0-5]

SUFFIX:
407 - Angular dimension suffix [0-5]
408 - Linear dimension suffix [0-5]
409 - Radius dimension suffix [0-5]
410 - Diameter dimension suffix [0-5]
411 - Chamfer dimension suffix [0-5]
412 - Coordinate dimension suffix [0-5]
450 - Dimension arc prefix [0-5]
451 - Dimension arc suffix [0-5]
505 - Dimension Baseline suffix [0-5]
515 - Dimension Extended suffix [0-5]
525 - Dimension Distance suffix [0-5]
451 - Dimension arc suffix [0-5]


Lar

dcadRob

Prefix and Suffix  work, but Prefixtext and Suffixtext don't seem to do anything.

DrollTroll

You might be interested to know (I was) that when you set PrefixText and SuffixText in a macro, the program attempts to locate one of the currently-defined prefixes (or suffixes) that match your string, then sets the index to match. It does NOT attempt to set the prefix (or suffix) text to the actual string you specified.

I haven't revisited this parameter in a while, and I don't think I like it that way. I'll see if we can make it work a little better, either in 20.1 or 21.
25 years with DesignCAD

corlett

Hi All thanks for the response. This is the main reason I use DesignCAD.

I don't know how its done in the US but an ISO fit description looks like this    Ø25.4 +0.025 H8  (+0.000 would be above the +0.025)
DesignCAD put the H8 after the 25.4 but you can get away with that.

Lar
Thanks for the suggestion; while the prefix would remain nothing or (Ø) Dia the Suffix will be a mix of one letter one number, perms include
5, 6, 7, 8, 9 and d, e, f, g, h, k and D, E, F, G, H, K and this just covers the most common part of the standard. So although the simpler command prefix () and Suffix () work, its not an option here.

dcadRob
Thanks for confining that they don't work.  You stare at the documentation and try and try to make it work.  At least I can stop trying.

DrollTroll
Ho! Well thats the end of that.
I have written this very program twice before, once is Fortran 20yrs ago.  Its a pity that tolerancing is not a fundamental part of CAD systems.  Not a comment on DesignCAD, it seems to be missing most places.

I will wait for 20.1

DrollTroll
Before I spend time trying, can you confirm that "Change D_suffix" will change the actual text.  Perhaps I could put in a dummy suffix and then change it.

PS
This was all part of an evaluation of v20 as we (3 seats) to up grade from v16.  I have been put of the upgrade so far because of the mess v18 made of displaying the dimensions of my 7000 old drawings.  The 3D is better and v20 makes a better attempt at old dimensions.
I have been a user from the 2D days of v5.

DrollTroll

#7
Here's a quick and dirty sample of using Change D_PREFIX and Change D_SUFFIX:


'ChangeDimSuffix.d3m
' Illustrates the use of the Change function to change a dimension's suffix text
Alias D_PREFIX &H0A0D
Alias D_SUFFIX &H0A0E

pre$ = "Ø"
suf$ = " H8"
>Dimension
{
 <Pointxyz 5, 5, 0
 <Pointxyz 25, 5, 0
 <Pointxyz 25, 10, 0
}

Entity Sys(9)

Change D_PREFIX, pre$
Change D_SUFFIX, suf$

Update
Regen
End
 
25 years with DesignCAD

corlett

Thanks DrollTroll

Thanks for that I will have a go.

As I said this is all part of an evaluation of v20, so it will be a while before I get to it as a lot of the ordinary v16 macros I have don't seem to work under v20.

Clive

DrollTroll

#9
Are they all dimension-related, or is it more general than that?

One thing to note is that the "default" folder has changed; if you were loading files or calling other macros using "*\SomeMacro.d3m" for example, in V16 it would look in the same folder as DesignCAD itself; starting with V18 it now looks in the "My Documents\DesignCAD 3D Max nn" folder (where nn is the version), instead of the program location. (Caveat: this assumes you installed "For all users". If you installed "for me only", it would still look in the program folder as before.)
25 years with DesignCAD

corlett

No not dimension specific.

I have some really simple quick drawing macros.  Flip90 This just rotates the selected lines 90 degrees. It used to be a one button press, now it needs an <enter> to complete the turn. So I recorded a macro using rotate and got a macro identical to mine.  I cut and pasted the recorded script into my file and it works now.

I have V16 V18 (and all the updates) V20 the SDK and so many 'CustomMacro' folders its difficult to predict which version of the macro is bound to which key. So its just a case of running through things and sorting them out.

The bottom line is we will NOT be migrating to V20.  I will get a copy for 3D work.  The problem is that we work on large files typically 4Megs 10,000 entities 50,000 points AND if there are dimensions on the drawing THEN selection time on large files is toooo slow (each select takes ~1 second). 

I have noticed that when a 10,000 entity file with dimensions is selected "csrss.exe" takes 80% of the cpu and selection is slow.
The same file with no dimensions frees up the cpu for Dcad20.exe and selection is near instantaneous.   
The same file with all the lines deleted and ONLY the dimensions say 3000 points exhibits the same slowing of selection and the high CPU usage of csrss.exe

Anyhow, thanks for your great support.

PS
I have an old AMD Athlon 2500+CPU 1.83 Ghz 1.0GB Ram Running XP Service Pack 3 GeForce FX 5500
This is no speedster but not a bag of bolts either.
PPS
There are threads on the net about csrss.exe being infected, I have verified that this is not he case.