Jump to content

possible to have a script to use flatten?


jafooli

Recommended Posts

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • jafooli

    7

  • ReMark

    5

  • SLW210

    5

  • Dadgad

    4

Top Posters In This Topic

Posted Images

Here is a Macro for a button. You could probably follow that and make a script or just set up a button.

 

^C^C_UCS;;_move _all;;0,0,1e99;;_move _all;;0,0,-1e99;;_chprop;_all;;_thickness;0;;^M;

Link to comment
Share on other sites

You could also try using the CHANGE command with the ELEVATION option, as a macro, to affect the same results.

 

All points on the object must have the SAME Z value for Change>Elevation to work.

Link to comment
Share on other sites

ok thanks guys... when i copy and paste

^C^C_UCS;;_move _all;;0,0,1e99;;_move _all;;0,0,-1e99;;_chprop;_all;;_thickness;0;;^M;

into the command box is says

 

Command: ^C^C_UCS;;_move Unknown command "^C^C_UCS;;_MOVE". Press F1 for help.

Command: _all;;0,0,1e99;;_move Unknown command "ALL;;0,0,1E99;;_MOVE". Press

F1 for help.

 

am I doing something wrong??

Edited by SLW210
Link to comment
Share on other sites

Put on your thinking cap there SLW. Jafooli is using 2004. You remember back that far? You was just a youngin' then weren't ya? LoL

Link to comment
Share on other sites

ok thanks guys, ive figured out how to make a macro button but once I set it all up and execute the button it does not do any thing apart from change property.

 

what im trying to do is change a 3d polyline into a polyline, as autocad 2004LT does not have express tools I cannot use the Flatten function. So I was looking into finding if its possible a script to do such a thing? Is it possible?

Link to comment
Share on other sites

Something must be wrong with your macro. I have just tried the same procedure manually with 2002, and it flattened a 3D polyline :D

Flat3DPoly.jpg

Link to comment
Share on other sites

right ok urm dont know whats wrong then, when I apply the macro I get in the command -

 

Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]:

_thickness

Specify new thickness : 0

Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]:

Cannot change thickness for 3D Polylines.

Cannot change thickness for BLOCKs.

Command:

CHPROP

Select objects:

 

I click on object which is a 3d polyline then I get in command -

 

CHPROP 1 found

Enter property to change [Color/LAyer/LType/ltScale/LWeight/Thickness]:

 

now what do I do to change the 3d poly to a polyline??

Link to comment
Share on other sites

I use only the Move part of the proposed Macro. I already have my UCS in World, and do not need to change properties afterwards.

 

This is a copy of my command line:

 

Command: m

MOVE

Select objects: all

1 found

 

Select objects:

Specify base point or displacement:(I just pick a point anywhere on the screen) Specify second point of displacement or : @0,0,1e99

 

Command: m

MOVE

Select objects: p

1 found

 

Select objects:

Specify base point or displacement:(I just pick a point anywhere on the screen) Specify second point of displacement or : @0,0,-1e99

 

Your posted drawing was already all at zero, but this procedure does not work with 3D blocks. It works because you are taking AutoCAD's coordinates far out of the forseen accuracy, so by giving the z value an enormous value, AutoCAD gives up and sets the z values all the same. So when you reverse the move, then all z coordinates become zero. However, 3D blocks remember the differential z values and preserve those on the second move.

Link to comment
Share on other sites

I experimented with your new block.dwg and was able to create a polyline just by first exploding the object (into 1466 line segments) then recombining them using the PEDIT command and JOIN option.

Link to comment
Share on other sites

I was thinking of exploding too, and going that route, but didn't you have to zero out the z start and end points before you used PEDIT?

Link to comment
Share on other sites

You never mentioned you wanted to change a 3D Polyline to a 2D polyline.

 

Flatten will not do that either.

 

Being on LT you will need to use ReMarks method.

Link to comment
Share on other sites

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...