Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Get text length of dimension

Gears Phenom Gears Phenom
Gears Phenom

I was asked today by another developer if there was a way to determine the width of the text of a dimension. The reason being is that he has a project to generate a detail drawing using automation.

Historically we have only created general layout drawings using automation and as such there is bags of space to fit the few dimensions required. But with this project it is getting hard to fit the dimensions into readable positions, so to make better decisions around this my colleague would like to get the width of the dimension text.

I hold my hands up straight away and admit I haven't looked at the API at all around this subject yet, I was just hoping someone might have a quick answer.

Any idea if you can ask a dimension for its text width? I'm guessing internally NX knows this because it can automatically decide if the text should go between the extension lines or not.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Dell 7530 Precision, Win10, 32GB. Developing in: Java | C | KF
Production: [NX12.0.2 MP1]
3 REPLIES 3

Re: Get text length of dimension

Siemens Phenom Siemens Phenom
Siemens Phenom

You may check UF_DRF_ask_annotation_text_box / NXOpen.UF.UFDrf.AskAnnotationTextBox 

Re: Get text length of dimension

Gears Phenom Gears Phenom
Gears Phenom
Excellent, thanks. I'll take a look..
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Dell 7530 Precision, Win10, 32GB. Developing in: Java | C | KF
Production: [NX12.0.2 MP1]

Re: Get text length of dimension

Gears Phenom Gears Phenom
Gears Phenom

Yep, that does exactly what I want.

Thanks again.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Dell 7530 Precision, Win10, 32GB. Developing in: Java | C | KF
Production: [NX12.0.2 MP1]