Jump to content

Data Field and Diesel Expression, file name and layout name


itacad

Recommended Posts

Hello, I'm trying to automate the compilation of the attributes of some blocks...I would like to:

1) Write the filename without the extension

with this expression in data field i can write the file name, but it has the extension

%<\AcVar Filename \f "%fn6">%

with this diesel expression I can write the file name or part of it but I don't know how to cut the extension without counting the characters

$(SUBSTR,$(GETVAR,DWGNAME))

2) Write the file name starting from a certain character, for example the tenth, until its end but excluding the extension

$(SUBSTR,$(GETVAR,DWGNAME),10)

3) Write only a part of the layout name

with this data field I can write the name of the layout, but I don't know how to use only part of the string, for example the characters from the fourth to the eighth

%<\AcVar ctab \f "%tc1">%

is there a diesel expression to write the name of the layout?

Regards

Link to comment
Share on other sites

Hello, I found some answer for this post...

1) write the filename without extenion

$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),4))

3) For this point, now I understand! it was enough to replace the dwgname variable with ctab and use the expression!

for the rest I have to study well how these diesel exactions work!

Regards

Link to comment
Share on other sites

Thanks for the links!
Another combination I should make with some filename is to write the file name from a certain character (for example the tenth), up to its end but without the extension.

Let's see if I can with a combination of the previous cases.

Regards
 

Link to comment
Share on other sites

On 9/27/2019 at 4:04 PM, itacad said:

Hello, I'm trying to automate the compilation of the attributes of some blocks...I would like to:

1) Write the filename without the extension: %<\AcVar Filename \f "%fn2">%  You missed the checkbox.

 

2) Write the file name starting from a certain character, for example the tenth, until its end but excluding the extension:

%<\AcDiesel $(SUBSTR,$(GETVAR,DWGNAME),10,$(-,$(STRLEN,$(GETVAR,DWGNAME)),13))>%

 

3) Write only a part of the layout name with this data field I can write the name of the layout, but I don't know how to use only part of the string, for example the characters from the fourth to the eighth: %<\AcDiesel $(SUBSTR,$(GETVAR,CTAB),4,4)>%

 

Link to comment
Share on other sites

I think I managed to use only an indefinite part of the filename starting from a certain character, up to the end, without the extension!

The files I use have the following structure:

- the first alphanumeric part always consists of 18 characters

- the second part (which is what I need), descriptive and with a non-predetermined number of characters

If I add the characters to remove to the formula that deletes the extension to the filename, I get the part of filename that I need but without having to count anything!

regards

C2019-015-EL-007S QE.GEN.dwg

C2019-015-EL-008P PIANO 1 FM.dwg

Link to comment
Share on other sites

14 hours ago, itacad said:

I think I managed to use only an indefinite part of the filename starting from a certain character, up to the end, without the extension!

The files I use have the following structure:

- the first alphanumeric part always consists of 18 characters

- the second part (which is what I need), descriptive and with a non-predetermined number of characters

If I add the characters to remove to the formula that deletes the extension to the filename, I get the part of filename that I need but without having to count anything!

regards

C2019-015-EL-007S QE.GEN.dwg 58.24 kB · 1 download

C2019-015-EL-008P PIANO 1 FM.dwg 51.02 kB · 1 download

This should work as the DIESEL to remove both the first 18 characters and the extension leaving the descriptive and with a non-predetermined number of characters you are looking for:

$(substr,$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),4)),19)

 

Link to comment
Share on other sites

  • 2 years later...

Someone knows how can I remove the first 12 charts of my file name?

I'm Using that expression to get the file and all UpperCase
$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),4)) \f "%tc1%fn6">%

File Name: P0000-E-000 Proposed xFSDV xxxxxxx xxxxxxx
I want remove P0000-E-000

Link to comment
Share on other sites

  • 1 month later...
On 2021/10/8 at PM6點57分, Ciro said:

有人知道如何刪除文件名的前 12 個圖表嗎?

我正在使用該表達式來獲取文件和所有大寫
$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),4)) \ f "%tc1%fn6">%

文件名:P0000-E-000 提議的 xFSDV xxxxxxx xxxxxxx
我想刪除 P0000-E-000

$(substr,$(getvar,"dwgname"),1,$(-,$(strlen,$(getvar,"dwgname")),35))
 

2021.12.10_n8.png

Link to comment
Share on other sites

  • 1 year later...
On 9/27/2019 at 4:04 PM, itacad said:

Hello, I'm trying to automate the compilation of the attributes of some blocks...I would like to:

1) Write the filename without the extension

with this expression in data field i can write the file name, but it has the extension

%<\AcVar Filename \f "%fn6">%

with this diesel expression I can write the file name or part of it but I don't know how to cut the extension without counting the characters

$(SUBSTR,$(GETVAR,DWGNAME))

2) Write the file name starting from a certain character, for example the tenth, until its end but excluding the extension

$(SUBSTR,$(GETVAR,DWGNAME),10)

3) Write only a part of the layout name

with this data field I can write the name of the layout, but I don't know how to use only part of the string, for example the characters from the fourth to the eighth

%<\AcVar ctab \f "%tc1">%

is there a diesel expression to write the name of the layout?

Regards

For #3 - $(SUBSTR,$(GETVAR,CTAB),3,7)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...