Jump to content
Developer Wiki and Function Reference Links ×

Getting extrusion value


Paolo

Recommended Posts

Your suggestion has been the key! Thank you!

Here's a procedure to increase all the extruded object in a selection of a user given value:

[font:Courier New]procedure increaseExtr;

{the goal is to increase extruded objects in the selection of a user requested value}

var

oggetto:HANDLE;

increaseValue : REAL;

FUNCTION increase(h:HANDLE):BOOLEAN;

var

height,width,depth:REAL;

xRot, yRot, zRot:REAL;

p0X, p0Y, p0Z: REAL;

p1X, p1Y, p1Z: REAL;

result, isMirroredXY: BOOLEAN;

begin

{check if the obj is an extrusion}

if (GetType(h) = 24) then

BEGIN

result := Get3DOrientation(h, xRot, yRot, zRot, isMirroredXY);

Get3DCntr(h, p0X, p0Y, p0Z);

SetRot3D(h, 0,0,0 , 0,0,0);

{here depth = extrusion value}

Get3DInfo(h, height,width,depth);

{I increase the depth}

Set3DInfo(h, height,width,depth+increaseValue);

Set3DRot(h, xRot, yRot, zRot , 0,0,0);

Get3DCntr(h, p1X, p1Y, p1Z);

{move of the misplacement p0-p1}

Move3DObj(h, p0X-p1X, p0Y-p1Y, p0Z-p1Z);

Get3DCntr(h, p1X, p1Y, p1Z);

END;

increase := FALSE;

end;

begin

{ask the value to increase}

increaseValue := RealDialog('Increase extrusions in the selection of this value','10');

{apply to the selected set of objects}

ForEachObjectInList(increase, 2, 0, oggetto);

end;

run(increaseExtr);[/font]

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...