Jump to content

Recommended Posts

Posted

It's me again. The belligerent OP with another mystery that I hope someone can shed some light on.

 

To see my problem, create a new drawing using the standard acad.dwt template, then load the "Hidden" linetype in it. Then load and run this LISP code:

 

(defun c:test ( / r1)
 (vl-load-com)
 
 (start)

 (setvar 'CECOLOR "Red")
 (command "._PLINE" '(0.0 0.0) "@24<0" "@2<270" "@2<180" "@6<270" "@2<0" "@9<270" "@24<180" "c")
 (setq r1 (entlast))
 
 (setvar 'CECOLOR "Yellow")
 (setvar 'CELTYPE "Hidden")           ; COMMENT THIS LINE
 (command "._CELTSCALE" "0.25")   ; AND THIS ONE TOO FOR A DIFFERENT TRIM ACTION!
 
 (command "._LINE" '(16.0 -4.0) "@7<0" "@8<270" "")
 (command "._LINE" '(16.0 -4.1875) "@7<0" "")
 (command "._LINE" '(22.8125 -4.1875) "@7.8125<270" "")
 (command "._ZOOM" "A")
 
 (command "._TRIM" r1 ""
      '(23.0 -3.5) '(22.125 -5.0) "")
   
 (reset)

 (princ)
)


(defun start ()
 (setq oldlayer (getvar "clayer"))
 (setq oldsnap (getvar "osmode"))
 (setq oldpick (getvar "pickbox"))
 (setq oldcmd (getvar "cmdecho"))
 (setvar "osmode" 0)
 (setvar "pickbox" 0)
 (setvar "cmdecho" 0)
 (princ)
)

(defun reset ()
 (setvar "clayer" oldlayer)
 (setvar "osmode" oldsnap)
 (setvar "pickbox" oldpick)
 (setvar "cmdecho" oldcmd)
 (setvar 'CECOLOR "ByLayer")
 (setvar 'CELTYPE "ByLayer")
 (command "._CELTSCALE" "1.00")
 
 (princ)
)

My goal is to use the red pline shape to trim the two pairs of yellow hidden lines. If this runs on your system like it does on mine, the results is that only three (3) of the four line get trimmed. Now, comment out the two lines shown which change the line type. Reload and run it again and poof, now all four lines trim properly.

 

From what I see, the vertical line on the left ends up (at .25 linescale) with the red pline passing between two of the dashes making up the line. And thus it does not get trimmed. Now if I change the LTSCALE to .125 or just make the lines continuous, the trim works properly.

 

In a process such as I'm undertaking, (complete automation of drawings) this is a real deal breaker. Unless there is something about the trim command which is slipping by me.

 

I should add, that this process draws an assembly to scale, based on user input into an Excel file. The size of the pline is never the same and the location of all of the lines varies based on the dimensions the user input. I have the math on the model down to a Tee, but without trim working on lines in their final state, my life just got very difficult.

Posted

Hi Bill,

 

If I remember correctly trim requires an input similar to the return value of entsel. That is a list with an ename and a 3d point in the format of

 

(<ename> . (3d point))

 

I'm not sure if this is of help for your case but it was something I came across previously that caught me

 

Regards

 

Jammie

Posted

I have found that by adjusting the size of the trimming fence I can get this to work properly. I just never would have thought that the trim command was that sensitive to the locations of the gaps in the hidden and dashed lines, etc...

 

I know, it sucks to be me!

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