Author Topic: Code to auto-update blocks. . . help?  (Read 10316 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

tcdan

  • Guest
Code to auto-update blocks. . . help?
« Reply #31 on: July 31, 2005, 01:16:49 AM »
ERRORS RIGHT NOW

1.  If the user presses escape during execution - an error occurs.  Not sure what to do about that one.


I attached the block which the program inputs here.

tcdan

  • Guest
Code to auto-update blocks. . . help?
« Reply #32 on: July 31, 2005, 01:21:58 AM »
Quote
read these
http://www.theswamp.org/phpBB2/search.php?mode=results

Was that a joke CAB or just trying to tell me to do my own search? . . . you just attached the search dialog.

tcdan

  • Guest
Code to auto-update blocks. . . help?
« Reply #33 on: July 31, 2005, 04:38:55 AM »
OK - everything seems to work now!!!!
WOOHOO!

I included a setup file so the user can input what block name and attribute tag will be modified.  It also asks you to set the scale of the block and an optional offset.

There are 2 things I would like to add to the program another time:

1.  Allow the user to press escape to exit command (instead of clicking point or inputting data).

2.  Rotate the block so that it is perpendicular to the polyline.  This would just require me to determine the angle of the polyline at the insertion point of the block. . . I'm not quite sure how to do that though.  I could go about it by drawing a line snapped perpendicular to the polyline at that point and subtracting 90 degrees from the angle of the line. . . but that seems like the long way around doesn't it?  There must be a way to get to the segment in question, perhaps using (entnext), and then determing the angle of the segment.  hmmmm

Any ideas?  I'll check into this at a better hour :)

Program here if interested

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Code to auto-update blocks. . . help?
« Reply #35 on: July 31, 2005, 02:53:55 PM »
Quote from: tcdan

There are 2 things I would like to add to the program another time:

1.  Allow the user to press escape to exit command (instead of clicking point or inputting data).
This is where your error handler comes in to play. If it is setup correctly, it will take care of the ESC key. Just make sure to reset your variables that you would normally reste when exiting, and you may need to place a (command) or two to terminate any active command call.
Quote from: tcdan

2.  Rotate the block so that it is perpendicular to the polyline.  This would just require me to determine the angle of the polyline at the insertion point of the block. . . I'm not quite sure how to do that though.  I could go about it by drawing a line snapped perpendicular to the polyline at that point and subtracting 90 degrees from the angle of the line. . . but that seems like the long way around doesn't it?  There must be a way to get to the segment in question, perhaps using (entnext), and then determing the angle of the segment.  hmmmm
See the 7th post in THIS thread A bit more work would be needed if the pline has arcs in it, but it could be done.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Code to auto-update blocks. . . help?
« Reply #36 on: July 31, 2005, 06:46:36 PM »
direct to 7th post
Right Click on the Paper icon next to the word Posted to get the direct link.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Code to auto-update blocks. . . help?
« Reply #37 on: July 31, 2005, 07:56:27 PM »
I thought it would benefit tcdan to read the entire thread.......;)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Code to auto-update blocks. . . help?
« Reply #38 on: July 31, 2005, 09:12:33 PM »
Sorry, that one went right by me. :oops:
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

tcdan

  • Guest
Code to auto-update blocks. . . help?
« Reply #39 on: August 01, 2005, 01:01:39 AM »
Alright Jeff - now I have the block inserting perpendicularly to the line and rotating to make the text readable!  Great!  

Quote
This is where your error handler comes in to play. If it is setup correctly, it will take care of the ESC key. Just make sure to reset your variables that you would normally reste when exiting, and you may need to place a (command) or two to terminate any active command call.


Well, I'm not sure how to catch ESC in an error handler. . . don't write this one for me - maybe just point me a little. :)

ALso, is there a way to make global variables persist between sessions?. . . like maybe writing some information into a dictionary (whatever that is)?

CAB - read a bit of your links, yeah a lot of reading if I want to get it all :)  Thanks.