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

estrarre rangebox di un body da un partdocument

  • Thread starter Thread starter Adahm
  • Start date Start date

Adahm

Guest
Bye to all,
someone knows how to extract the dimensions of encumbrance (rangebox) di un body da un partdocument?
not starting from a set, but interrogating the ipt file.
Thank you.
 
Hello, Adam.
time ago I had made an ilogic rule that does so and also creates custom iproperties. take off here:

syntaxeditor code snippet

'take active document

dim partdoc as partdocument
partdoc = thisdoc.document
Catch
dim assydoc as assemblydocument
assydoc = thisdoc.document



' Take the file name
filename = thisdoc.filename(false)

'measure the overall dimensions x, y, z
x_measure = measure.extentslength
y_measure = measure.extentswidth
z_measure = measure.extentsheight

' order the size measured to find maximum and minimum
dimx = maxofmany(x_measure,y_measure,z_measure)
dimy = minofmany(x_measure,y_measure,z_measure)
dimz = (x_measure + y_measure + z_measure) - dimx - dimy

' assigns variable values with decimal precision 2
dimx = round(dimx, 2)
dimy = round(dimy, 2)
dimz = round(dimz, 2)


str_dimx = cstr(dimx)

str_dimz = cstr(dimz)

str_dimy = cstr(dimy)



create custom properties
iproperties.value("custom", "lung") = str_dimx
iproperties.value("custom", "larg") = str_dimz
iproperties.value("custom", "alt") = str_dimy

messagebox.show("dim x: " & str_dimx & "; dim z: " & str_dimz & "; dim y: " & str_dimy, "piece size")

inventorvb.documentupdate()
ilogicvb.updatewhendone = true
 
the rule I posted calculates the whole ipt, not the single solid body though.
 

Forum statistics

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

Members online

No members online now.
Back
Top