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

adding or subrtracting in diesel expression

7 REPLIES 7
Reply
Message 1 of 8
sean.keohane
1124 Views, 7 Replies

adding or subrtracting in diesel expression

Hi,

I might be asking in the wrong forum, if so, apologies.

I have been asked to make the title text larger (drawing are being issued at 1/2 scale, A1 to A3) on a large set of drawings. My solution was to copy the title attibute block to a temporary location, resize the attributes and redefine the block by runnung a script (scriptpro). Some drawings needed the title line split to next line so I had to move the sheet counter (1 of xx, 2 of xx etc.) which was linked to drawing file name for number with a field/formula. The diesel expression shown below extracts that number. My problem is I cant figure out how to I can edit this expression to allow for a set not starting at 1. I had used a formula to subtract the difference,but how do you express this to run in a script?

Many thanks

Sean

This is my script......

attreq
0
-insert
ftc-gwp-a1-nosheet-stb=ftc-gwp-a1-nosheet-stb
0,0
1
1
0
erase
last

attreq
1
attsync
s
(ssget "X" '((0 . "INSERT")(2 . "ftc-gwp-a1-nosheet-stb")))
y
_gatte
b
ftc-gwp-a1-nosheet-stb
title4
PROPOSED ALTERATIONS
y
_gatte
b
ftc-gwp-a1-nosheet-stb
title5
Sheet %<\AcDiesel $(substr,$(getvar,dwgname),16,$(-,$(strlen,$(getvar,dwgname)) ,19))>% of 6
y
qsave

7 REPLIES 7
Message 2 of 8
stevor
in reply to: sean.keohane

If you can use 'ssget, then why not do it all in autolisp?
S
Message 3 of 8
sean.keohane
in reply to: stevor

Hi,

Thanks for the reply. I was running  _gatte through my script and it is easy to use this way. I figured out the diesel expression (a web crawl) to extract a number from the drawing file name and subtract a given number from that number. As follow...

 

Sheet $(eval,"$(-,$(eval,"$(substr,$(getvar,dwgname),16,$(-,$(strlen,$(getvar,dwgname)) ,19))"),10)") of 20

 

In this case I'm taking the characters between 16 and 19 and subtracting 10 from that value. Looks crazy, but it works.

thanks

Sean

Message 4 of 8
sean.keohane
in reply to: sean.keohane

Hi,

Correction - this is what is used in the script.

 

%<\AcDiesel $(eval,"$(-,$(eval,"$(substr,$(getvar,dwgname),16,$(-,$(strlen,$(getvar,dwgname)) ,19))"),10)")>%

 

Regards

Sean

Message 5 of 8
pendean
in reply to: sean.keohane

While you work it out here with these good folks... You all, at your office, might want to consider upgrading your drafting standards and start using Annotative Text, Dims and blocks. Then switching scales for plotting is a simple toggle and not much else.

Scaling and rescaling whole blocks is very old school and time consuming (waste of billable hours).
Message 6 of 8
sean.keohane
in reply to: pendean

Hi Dean,

I think you misunderstood the issue.

The attribute text resized was part of the title block in paper space. The drawings we produce are prepared on a A1 title template. After the entire set was prepared the client wished to issue them at A3 (1/2 scale) and asked if the title text could be made bigger. Not a problem, only the sheet counter field needed to be split to a new line to fit into the drawing sheet . Hence the question on how the diesel expression would be written to automatically input counter number through script.

I wasn't actually resizing the block, just printing it at 1/2 scale.

I have been using annotative dim and text, dynamic blocks, fields etc (for quite some time) and give all new features in Autocad a fair shake before I decide to use them or not. I pride myself in keeping up with the Jones.

If there is a way though, that I've missed, to have the attibutes in a title sheet to resize and flow to the next line when printing to a different page size, I will certainly update my templates to accommodate that feature.

Thank you,

Sean

Message 7 of 8

Is it not possible to split up the field? So you have something like "Sheet (field 1) of (field 2)".  Field 1 is your formula and make a custom field for total sheets that gets filled out in drawing properties.

Message 8 of 8

Hello Christopher,

You are right. In my case though, the job had been set up without sheet set. (Another good reason to use sheet sets)

The job is out the door now, and I guess it never hurts to figure things out in different methods.

Thanks for the reply

Sean

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

Post to forums  

Autodesk Design & Make Report

”Boost