Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Journal for expression creation

Status
Not open for further replies.

igor89

Mechanical
Joined
Feb 26, 2015
Messages
5
Location
PL
Hi.
I am trying to develop the journal that will create a parameter = hole tap drill diameter
I have some code written and it works but for some reason it is not showing value of Tap drill diameter properly.
for example if TDD = 12.1 my code will create a parameter value is which is equal to 12.
I have no Idea why.
Can someone give me an example for this one?
I just do not know what is the problem.
Many many thanks in advance.
 
I would love to do that, but it is at work.
I am going to try to recreate it, but it is not going to be accurate.

Here is how it looks.
I crate a Journal by recording it. So i press record then double click on the hole, then stop record.
Then i try to edit it.

And i try to do the following.
Dim A as string = ""
A = holebuilder1.tapdrill.diameter.value

Dim unit one as unit.....(do not remember) but i determine it as millimeters


Dim expression1 As Expression
expression1 = workpart.createexpression.withunits("D=1",unit 1)
workpart.expression.edit.withunit(expression1,A,unit1)


So it looks something like that. I am sorry if I got it wrong, but I can show the code, it is at work and i am home.
I tried to dim it as string, but no matter what I does not work, and the code form above gives me 12. Not 12.1
I tried to create a text file and it work fine, showing 12,1 as suppose to.
 
I am done with this code)
It works, have to do some adjustments.
But I have few question:
How does NX names its parameters?
it gives them default names, i would like to do the same with the ones I create?
 
So there is one more question to all of you.
I have an expressions A
And expression B
And expression C = A+B
Expression A name = ("A"+name1)
Expression B name = ("B"+name1)
Name 1 is a something a have form the input box.
Then I need to do something like that
Workpart,expression.Createexpression ("String", Dimensions = sting value (A)+""x""+string value B)
And this is not working.
code is not accurate, but i have the proper one in place.
Please advise on the meter.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top