• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

block label on dft with formulas

Papao

Guest
Good morning to all,
It is for a while now that I do not give peace in order to solve a trivial problem (maybe) in the draft environment of itself;
I would like to assign to a block label the last two values contained in the variable "%{filename (no extension)}".
I tried with excel's vba but I stopped after the extraction of value because I don't know how to assign to the cart.
I have identified the label to fill out (named etp_rif) and the variable "solidedgedraft.blocklabel" But now what?

I appeal to you, if someone knows an alternative way (maybe by entering a formula that extracts the last two digits of the variable) or how to complete the assignment of the block attribute.
Thank you all.
 
I don't understand anything. make a concrete example, for example: I have "abcde 01 23" , I have to extract "01" and "23". . .
for block labels, in property, there is a compiled table from time to time: this is usually sufficient in 99% of cases, try it.
 
Let's start well...
Meanwhile thanks for the interest, then I try to be clearer proceeding first on the easiest road to do:
I am in the draft environment, I would like to extract from the variable %{filename (no extension)} only the last two digits of its value and assign it to a new variable.
example:
variable "filename" = 1025.02.44 (I want to extract from this code, only the value 44 assigning it to a new variable)
I did not find explanations for how to insert string extraction formulas inside the block labels.
 
I don't think there are automated methods to do what you ask, maybe it's better to change the way to get to an efficient solution.
I'm sorry to use you to create a macro because if this should give you security, maybe it's easier to forget to launch the macro, so that it's launched 'beforesafe' is not so easy.

Maybe coloring is easier. when I put hand at the edges of a view or quotas, or lines and writings that should be recalled, I use my "hand" style of blue or blue color, so stand out to the eye.
Also as mentioned above, I would check the "normal" possibilities offered by block labels
 
we try another way;
can you assign to a variable of if the value contained in a cell of excel?
 
I don't think so.
filename = 1025.02.44 when you compose it? Entering a field, a property where you enter (repeats) "44" is a problem?
 
is composed to save the file (it is the design num. and it is progressive, the first free) to write it manually on a second field vanifies the automatic work. so much it is worth writing it directly in the cart.
 
the program that makes you progressive and suggests the file name for the rescue you wrote it?
If yes, you can put there the function to add a custom-property "progr=44" so you do not lose automatism.
Code:
dim nomefile = "c:\file.dft"
dim propname = "progr"
dim propvalue = "44"

dim objprops as object
dim objprop as object

set objprops = createobject("solidedge.fileproperties")
call objprops.open(nomefile)
set objprop = objprops("custom") proprieted della scheda personalizza

call objprop.add(propname, propvalue)


call objprops.close
seven objprops = nothing
set objprop = nothing
 
wasp_83 you are fantastic, unfortunately the name of the file takes place completely manual: file>salva> add hand file name and then save.
However, it seems interesting to me that your solution completes my programming part already placed at the beginning.
I hope that by making a "cut and sew" I can manage.
goes as long as the macro is always launched manually. . leaving the problems you expose.
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top