Author Topic: Just Once  (Read 3395 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
Just Once
« on: October 06, 2004, 09:12:32 PM »
Hey,
Is it possible to to set up a routine to only run once in a dwg for the life of the dwg......Been using a routine that scales the dwg up 12x (also does other things).....

And if the program gets initiated  twice the dwg would be scaled up 24x.......Scary....Microstation Xref's......
 :shock:

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Just Once
« Reply #1 on: October 06, 2004, 09:41:20 PM »
Could be done a number of ways, check the extents, set a persistant flag etc., write the stats to a logfile. How ambitious do you feel?
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Anonymous

  • Guest
Just Once
« Reply #2 on: October 06, 2004, 10:31:19 PM »
Im only Autolisp capable <barely> and now need some psudeo code to help me along if the routine is possible....

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Just Once
« Reply #3 on: October 07, 2004, 12:30:27 AM »
Could you test to see if block '*ScaleX12' is in the drawing.
If not scale the drawing and insert the block. just depends on how
secure the flag has to be.

Or use
Code: [Select]
(AddDictToEntityXDict (tblobjname "layer" "0") "MyHardOwnedDick")
to hide the flag. 8)
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.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Just Once
« Reply #4 on: October 07, 2004, 12:35:34 AM »
How about a really simple one that should cause no problems....
Create an empy drawing with nothing in it.... no extra text styles, dimstyles, layers ... nothing .... set the block current layer to 0 (as should be the case for blocks anyway in most circumstances) save that drawing to the HD.....
In your routine ... insert this block on layer 0 with a scale of 1:1 at the point identified by BASE.
Scale the entire drawing as required, this block will also be scaled IF you select the entire database using (ssget "X")
Next time when the drawing is opened, have it check for the existence of that block, if it is there (and 12X scale) then the drawing is already scaled (by this proggie)

I suppose the pseudocode would be...
Code: [Select]

check for SCALEBLOCK
If SCALEBLOCK .... then
If SCALEBLOCK scale = 1 then
 Scale the drawing
Else if SCALEBLOCK scale = 12 then
 DO NOT scale the drawing
end second if
Else Insert SCALEBLOCK at BASE
Scale entire drawing as selected via (ssget "x") 12x
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

rude dog

  • Guest
Just Once
« Reply #5 on: October 07, 2004, 12:38:52 AM »
Fantastic idea.....never would of thought of that

hey if its scaled up 12 times I wouldnt hide it
 :lol:

SMadsen

  • Guest
Just Once
« Reply #6 on: October 07, 2004, 06:02:06 AM »
CAB, good thing I wasn't drinking coffee when noticing the name of the dictionary  :lol:

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Just Once
« Reply #7 on: October 07, 2004, 08:16:53 AM »
Yep I got a chuckle out of that too.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Just Once
« Reply #8 on: October 07, 2004, 08:43:53 AM »
Quote from: SMadsen
CAB, good thing I wasn't drinking coffee when noticing the name of the dictionary  :lol:
Yea, that one got me too. It's Michael's sly humor. see his code
http://theswamp.org/phpBB2/viewtopic.php?t=2646
I just couldn't resist propagating it.
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.