Jump to content

Things Which Work Manually But Can't Be Coded


Recommended Posts

Posted

This project I'm working on is one which creates an entire drawing without any user input. As I work through this I find that there are certain things which just don't work the same with code as when doing it manually. This latest is an example I found with the trim command. I should mention that I have some rather complex trim operations going on with this and they are working fine. But this one seems to elude me. The magenta assembly is a block which the code inserts. The green and yellow horizontal lines are also coded and I wish to trim them around the large circles in the block. The yellow cross hair shows the location I'm chosing as the trimming point. It's the top quadrant of the large circles. I then choose a crossing rectangle (right to left) which crosses the green and yellow horizontal lines. I've also tried selecting a point on each line. What happens is the trim operation completes but I'm left with the condition on the left. When what I want is what is shown in the middle circle. The middle circle shows what happens when I do this exact same operation manually. I have also tried changing the zoom on this and that still ends up with only a partial trim. The osmode is set to 0 and pickbox is also 0. Like I said I have had great success with this on other parts of the drawing. But this one appears to be elusive and just may not be do-able.

 

My thinking is because this is a block and even though I select the point at the top quadrant, when the code runs it's selecting all of the block, even though manually I can do this and it works fine. My next step is to insert another circle over the large one and choose it as the trimming object, then I will have to erase it once the trim is over. If anyone has a suggestion on how to avoid this added step, I'm all ears.

 

 

TrimIssue.jpg

Posted

Setting PICKBOX to 0, the points provided within command line must be exactly on the object. If your routine is something like

(command "TRIM" point_on_circle "" point_on_first_line point_on_second_line "")

then somehow, at the point_on_circle, you missed, so nothing is selected and the command goes further and trim each selected object at each intersection is found.... EXACTLY like Trimming manually.

Posted

Thanks for your reply. I am using exact coordinates on this and I must be hitting them because the trim works, at least partially. The trouble comes from selecting the quadrant of the circle in the block manually vs selecting in the code. When I do it manually the selection becomes only the circle. But when it's done with code the selection becomes the whole block, which means all the other lines become trimming edges.

 

I found a solution for this by drawing a circle of the same size over the ones in the block and using it as the trim object. Then I must erase it after it's done. The repeat loop then moves down the line to the next one and starts the whole process over. Once it loops through the right number of circles it ends and that's that.

 

I know it sounds like a lot of trouble but this is a drawing that has to be completely done with code. No user input is allowed.

Posted

Try to change pickbox to a different value and see what's happens.

I could replicate your result with pickbox set to 0.

For pickbox set to 5, the command works fine.

Posted

And EXTRIM draws a temporary rectangular boundary box to surround a block and trims on that, so won't give the desired trim results between blocks: the lines would then have to be extended back to the block.

 

Steve

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