CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz] ARKANCE | CONTACT - CZ | SK | EN | DE
Over 1.096.000 registered users (EN+CZ). AutoCAD tips, Inventor tips, Revit tips. Try the new precise Engineering calculator and the updated Barcode generator. New AutoCAD 2026 commands and variables.
RSS channel - CAD tips RSS tips
RSS discussions

Discussion Discussion forum

?
CAD discussions, advices, exchange of experience

CAD Forum - Homepage CAD discussion forum - ask any CAD-related questions here, share your CAD knowledge on AutoCAD, Inventor, Revit and other Autodesk software with your peers from all over the world. To start a new topic, choose an appropriate forum.

Please abide by the rules of this forum.
This is a peer-to-peer forum. The forum doesn't replace the official direct technical support provided by ARKANCE for its customers.
How to post questions: register or login, go to the specific forum and click the NEW TOPIC button.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Topic ClosedDiesel Field Expression - If Statement

 Post Reply Post Reply
Author
martingtc View Drop Down
Groupie
Groupie


Joined: 17.Jun.2016
Location: United Kingdom
Using: 2008LT
Status: Offline
Points: 28
Direct Link To This Post Topic: Diesel Field Expression - If Statement
    Posted: 17.Jun.2016 at 10:30
Hi, I'm new to the world of fields and diesel (using 2008 LT so I dont have a right click menu)

I've managed to set up some auto fills based on partial filenames etc. One I'm stuck on is a drawing ref


Basically we call our drawing files a 5 digit reference. I have done this one.
Our sheet numbers are 3 digits, again, this is sorted.

When we revise the drawing, it will become XXXXX-Rev01. I'm trying to add the -Rev01 part to the sheet number which I can do, but if the drawing is not yet revised (so still XXXXX) it shows up as ----

I'd like to remove these and show blank, unless there is a -Rev01, then show that if that's the case.


Can anyone help??

Thanks in advance
Back to Top
martingtc View Drop Down
Groupie
Groupie


Joined: 17.Jun.2016
Location: United Kingdom
Using: 2008LT
Status: Offline
Points: 28
Direct Link To This Post Posted: 20.Jun.2016 at 09:51
Can anyone help??
Back to Top
Vladimir Michl View Drop Down
Moderator Group
Moderator Group

Arkance Systems CZ

Joined: 26.Jul.2007
Location: Czech Republic
Using: Autodesk software
Status: Offline
Points: 2120
Direct Link To This Post Posted: 20.Jun.2016 at 10:01
This DIESEL expression will take the drawing name from the sixth character:
 
$(substr,$(getvar,dwgname),6)
 
You can combine it with $(if - based on string length or the "Rev" substring.
 
Vladimir Michl (moderator)
ARKANCE - https://arkance.world - Autodesk Platinum Partner
Back to Top
martingtc View Drop Down
Groupie
Groupie


Joined: 17.Jun.2016
Location: United Kingdom
Using: 2008LT
Status: Offline
Points: 28
Direct Link To This Post Posted: 20.Jun.2016 at 12:25
Can you explain the IF side of it please?

Example;

Drawing no. 101 - my paperspace (at the moment) shows 101 - perfect

filename 12345-Rev01
I want my paperspace to show 101, but also the -Rev01 from the filename. I can get this to work, but only if there is a Rev.

If the file is 12345, the paperspace titleblock shows 101----

:( I'd like to hide the dashes if there are no characters to show and I'm so new, I don't know how to control an IF statement just yet

Thanks,

[edit, the 101 drawing no. is pulled from a tab, the Rev01 needs to be pulled from the filename - so in theory 2 different diesel expressions next to each other?]


Edited by martingtc - 20.Jun.2016 at 12:37
Back to Top
martingtc View Drop Down
Groupie
Groupie


Joined: 17.Jun.2016
Location: United Kingdom
Using: 2008LT
Status: Offline
Points: 28
Direct Link To This Post Posted: 21.Jun.2016 at 09:25
Anyone please? It's for work and I'm really struggling :(
Back to Top
martingtc View Drop Down
Groupie
Groupie


Joined: 17.Jun.2016
Location: United Kingdom
Using: 2008LT
Status: Offline
Points: 28
Direct Link To This Post Posted: 24.Jun.2016 at 15:34
Anyone?
Back to Top

Related CAD tips:


 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0,078 seconds.