Jump to content

Change line linetype and colour in multiple drawings


4o4osan

Recommended Posts

Dear All,

 

I've been able to achieve incredible things with lisp routines, tanks to you and this forum!

Now I am facing another simple, but extremely time consuming activity which I am trying to speed up with a lisp code.

 

We have few hundreds of final charts of a pipeline in which the long profile view was generated with another autodesk add on (Autochart) as an xref block. The block is stored in a separate folder and consists of few profile lines representing the pipe, meanseabed etc. There are straight lines representing the horizontal and vertical grid and they are all with default colour black and continues linetype

The challenge now is to change the grid line colour and linetype to the one which are required by our client standards and they are different than the default black/white colour and continues linetype and the horizontal has to be for example DASHED  and the verical DASHDOT, both grey.

 

I have some lisp codes combined which were working well and I was able to open list of selected drawings or folder with drawings and work with them as DBX objects changing the block attributes. So now I can make a list of drawings, for each drawing of the list, I can open and close , change globally the linetypes of layers (with vla-get-layers, vla-get-name...) , colours of blocks, but seems like I can't select only lines based on the 'Angle property 0 or 1.574 rad (PI) and change the colour and  linetype using the vla or vlax commands.

 

I can perform the ssget selection set inside of each drawing and filter and edit the objects, but then I need to really open them one by one.

 

If will try to post some codes tommorow, because I am out of the office, but this thing is really making me crazy.

 

Any help will be highly appreciated.

Link to comment
Share on other sites

You indeed cannot use ssget in the context of ODBX. But every line has an Angle property. Based on its value your code can decide what to do.

Link to comment
Share on other sites

Using a script is not as painfull as it sounds it will open, modify and close/save dwgs pretty quick. As there is no user input. You will need a lisp etc as part of the script.

Edited by BIGAL
Link to comment
Share on other sites

Thanks for your answers.

Open/close and run the simple ssget filter and change property will be easier indeed.

 

But isn't it there a way to make a selection based on angle/type/colour property using vla function?

 

Link to comment
Share on other sites

The angle of a line is a property so you can get angle, you can use a rounding factor to check if its 0.0 or 90.

 

other way
(setq ang (angle (vlax-curve-getstartpoint obj)(vlax-curve-getendpoint obj)))

(if (= (vla-get-objectname obj) "AcDbline")(alert "line found"))

Edited by BIGAL
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...