Jump to content

multi-polyline


masterfal

Recommended Posts

Hi All,

 

I've been using the standard multiline tool for quite a while but have always had this issue where our work is normally drawn using linetype scale of 20 and if i ever need to explode a multiline with a hidden line in it, it will always set it to linetype scale of 1. Meaning the dashes are way to small and this line needs to be manually fixed to have linetype scale of 20.

 

Thought i could maybe get around this using this multi polyline (all credit to the mighty Lee Mac for it) lisp routine i've had for quite a while but never really utilised properly. When i try and use it though it straight away creates polyline with linetype scale of 1 - even if i'm currently set to draw with lts of 20. Is there something in this routine which is specifying this or is there a way to amend it so it can output my polyline with linetype scale of 20? (I know i could maybe create a new linetype which could look the same with lts of 1 but don't want to add new linetypes and would prefer to keep the same lts for all)

 

MPlineV1-1.lsp

Link to comment
Share on other sites

Try adding this on a new line right below line #49; i.e. the line of code with (vl-cmdf "_.Pedit" ....):

(vl-cmdf "_.Chprop" (entlast) "" "_lt" "_Bylayer" "_s" (getvar "ltscale") "")

 

NOTE: It seems Multilines ignore the current setting of LTSCALE when creating, This would make the resulting polyline honor the linetype scale set currently in the LTSCALE variable.

Also note Lee's program leaves the linetype set to "Continuous" for some reason. I think this is because of the exploded Mline object itself. This code also sets it back to "bylayer".

Edited by pkenewell
Link to comment
Share on other sites

You can get at the mline style properties, so get current style, this should include the scale of the lines make a list, as Lee is doing entnext maybe after the pedit do a chprop on entlast and set scale. Sorry not tested. 

 

The mline is a dictionary (dictsearch (namedobjdict) "ACAD_MLINESTYLE")) this may be something that Lee could add ask nicely.

 

 

Link to comment
Share on other sites

12 hours ago, pkenewell said:

Try adding this on a new line right below line #49; i.e. the line of code with (vl-cmdf "_.Pedit" ....):


(vl-cmdf "_.Chprop" (entlast) "" "_lt" "_Bylayer" "_s" (getvar "ltscale") "")

 

NOTE: It seems Multilines ignore the current setting of LTSCALE when creating, This would make the resulting polyline honor the linetype scale set currently in the LTSCALE variable.

Also note Lee's program leaves the linetype set to "Continuous" for some reason. I think this is because of the exploded Mline object itself. This code also sets it back to "bylayer".

 

tried this. thanks for that but it still seems to keep linetype scale of 1 which is same as before

Link to comment
Share on other sites

On 3/26/2021 at 1:43 AM, masterfal said:

tried this. thanks for that but it still seems to keep linetype scale of 1 which is same as before

 

This works correctly for me. I just set the current LTSCALE to what I want beforehand. I don't see any other way to draw the Mlines with a different Linetype scale than 1. There is no setting in the MLSTYLE for Linetype scale. Am I misunderstanding what you want?

 

Here - I have attached another modification of Lee's code, slightly different from the original modification I told you to add. Give this a try and let me know, or tell me what you actually want. Just make sure you set the LTSCALE system variable to 20 before using. 

MPlineV1-1_PJK.lsp

Edited by pkenewell
Link to comment
Share on other sites

On 3/26/2021 at 5:11 PM, pkenewell said:

 

This works correctly for me. I just set the current LTSCALE to what I want beforehand. I don't see any other way to draw the Mlines with a different Linetype scale than 1. There is no setting in the MLSTYLE for Linetype scale. Am I misunderstanding what you want?

 

Here - I have attached another modification of Lee's code, slightly different from the original modification I told you to add. Give this a try and let me know, or tell me what you actually want. Just make sure you set the LTSCALE system variable to 20 before using. 

MPlineV1-1_PJK.lsp 3.6 kB · 2 downloads

 

@masterfal Have you tried this yet or read my reply?

Link to comment
Share on other sites

  • 1 month later...
On 3/30/2021 at 3:06 AM, pkenewell said:

 

@masterfal Have you tried this yet or read my reply?

 

apologies for the delay.. got stuck working on something else

changing the ltscale changes the look of every other line in my job so i don't think thats an option..

 

i've attached dwg file to show what i'm trying to do. put simply when i explode the multiline, i need it to look like the single lines. both single lines and multilines currently set with linetype scales of 20 but when i explode the multiline it changes linetype scale to 1 so now they don't look the same anymore. meaning i need to either match properties or manually change linetype scale to 20 which is a pain. haven't tried it but makes sense if i have all those lines set to linetype scale 1 then when i explode the multiline it would stay 1 and the look wouldn't change but i need to keep linetype scale of 20 for this

 

hope that makes sense..

example1.dwg

Link to comment
Share on other sites

@masterfal I don't understand what you are saying. This routine doesn't use or convert existing drawing objects. This routine draws a NEW multiline, then explodes it into a Polyline. The lines don't exist beforehand so you need to set the current LTSCALE to what you want (20) before drawing them. The LTSCALE is not globally applied to already existing geometry - only to new items drawn. When you are done using the program, all you have to do is set the Linetype scale back to the previous setting.

 

Do you want the program to just hard-code setting the LTSCALE to 20 in the routine beforehand, then revert it back to the previous setting when you are done using? OR, have an option in the program to set the LTSCALE to what you want with a default of 20?

Link to comment
Share on other sites

If LTSCALE is altered without doing anything else, it will globally change all lines and polylines in the entire drawing and the LTSCALE will remain defaulted globally to this new setting until changed.  That is what it is meant to do. 

 

You have to drill down deeper.  To change the LTSCALE of a single object or a selection set of objects, you need to issue a CHPROP command beforehand which offers an object property menu, one item of which is LTSCALE. 

 

Exploding an object drops the released objects back to whatever their properties were before they were in the group or block.

 

You will have to modify the code to change the LTSCALE Object Property after exploding the mline and selecting the resulting individual lines.

Edited by Dana W
  • Like 1
Link to comment
Share on other sites

I suspect that you are somehow drawing everything with the CELTSCALE set at 20, rather than with a global LTSCALE set to 20.

 

 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

THIS ^^^^  but it only gives you 20 if LTSCALE is 1 since CELTSCALE is relative to LTSCALE.

 

Ain't that a confusing kettle of marbles.

 

That's why I resort to object properties for single occurrence cases, for instance when two hidden lines near each other need to be visually different but on the same layer.

  • Like 1
Link to comment
Share on other sites

i think i may have confused everyone.. apologies. i'm still getting my head around how all this stuff works properly

 

the ltscale or linetype scale factor (the global one) needs to be 1

the linetype scale of the line needs to be 20

 

i think i was getting these things mixed up previously.

 

celtscale is currently set to 20

  • Like 1
Link to comment
Share on other sites

Considering the problems that you are experiencing, maybe it would be simpler to create a new linetype.

 

*HIDDENX20,Hidden (20x) ______  ______  ______  ______
A, 127, -63.5
 

I always prefer to work with the global linetype scale. 

  • Like 1
Link to comment
Share on other sites

Agree with you Eldon for painted lines on road had the linetypes set to correct spacing with scale =1 so always correct, its not hard to make your own line types if you want simple dashed types.

Link to comment
Share on other sites

Sorry All. I didn't realize the LTSCALE variable worked globally on existing lines. This is something I normally never use. I always drawing in standard Linetype scale, then change it with the properties command afterword.

 

Perhaps adding a prompt for the desired scale with a default value in the routine as I stated before. This avoids system variables. See attached.

 

MPlineV1-1_PJK.lsp

Edited by pkenewell
Link to comment
Share on other sites

I'd love to be able to set up new linetypes but im working for new company and need to keep the general setup/linetypes etc in the drawings as is.

I guess down the track a bit i can tweak their templates and propose a better way to use them which would benefit everybody

 

On 5/21/2021 at 10:00 PM, pkenewell said:

Perhaps adding a prompt for the desired scale with a default value in the routine as I stated before. This avoids system variables. See attached.

 

great idea. scale only seems to apply to one of the lines though? so i end up with one set on 20 and the other one is set on 1. also i noticed these lines seem to come out set to 'by layer' meaning if i'm in a layer that draws continuous lines (which i usually am) it will make those hidden lines come out as continuous. the original multipolyline file works how it should aside from the scale of lines being 1. Can original routine be edited so the scale of lines created are set to 20? thats the only scale i'll ever be using it on

Link to comment
Share on other sites

12 hours ago, masterfal said:

great idea. scale only seems to apply to one of the lines though? so i end up with one set on 20 and the other one is set on 1. also i noticed these lines seem to come out set to 'by layer' meaning if i'm in a layer that draws continuous lines (which i usually am) it will make those hidden lines come out as continuous. the original multipolyline file works how it should aside from the scale of lines being 1. Can original routine be edited so the scale of lines created are set to 20? thats the only scale i'll ever be using it on

@masterfal Oops - The routine did not account for open Multi-lines with no endcaps. Corrected in the attached file. I just had to rearrange the PEDIT and CHROP commands for the resulting selection set to change the line type scale before joining the selection back into polylines.

MPlineV1-1_PJK.lsp

Link to comment
Share on other sites

10 hours ago, eldon said:

Why don't you just set CELTSCALE (Current Entity Line-Type Scale) to 20?

@eldon I would've thought that would be a good solution, but, as said previously, the CELTSCALE gets changed relative to the LTSCALE, which I think was giving the OP issues.  I personally was confusing the 2 system variables earlier, since I don't normally use them, opting to change the line type scale after the geometry is drawn.

Link to comment
Share on other sites

On 5/27/2021 at 4:32 AM, pkenewell said:

@masterfal Oops - The routine did not account for open Multi-lines with no endcaps. Corrected in the attached file. I just had to rearrange the PEDIT and CHROP commands for the resulting selection set to change the line type scale before joining the selection back into polylines.

 

oh thats awesome.. thankyou so much! one last thing, is it possible to set the desired linetype scale to always be 20? because thats what i will be inputting at that prompt everytime i use it so if it could somehow be pre-specified that would skip a step and then it'd be perfect

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...