TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Fabricio28 on September 01, 2014, 02:52:07 PM

Title: Hide Frame
Post by: Fabricio28 on September 01, 2014, 02:52:07 PM
Hi guys,

The code bellow insert a block. I'd like to hide the frame of the block. How Can I do that?
I have to explode the block and set hide frame.

Code: [Select]
(defun c:CQ nil
(command "_.layer" "_T" "MARGEM" "_M" "MARGEM" "c" "7" "" ""
     "_.layer" "_T" "MARGEM" "_U" "MARGEM" "_M" "MARGEM" "c" "7" "" "")
(command "LAYER" "S" "MARGEM" "" "insert" "MARGEM" pause "" "" ""))

(command "IMAGEFRAME" "0" "" "")?

didn't work.

Thank in advance
Title: Re: Hide Frame
Post by: ribarm on September 02, 2014, 12:27:43 AM
I had a similar problem a while ago with clipped xrefs, but only thing I did was to make smaller xrefs so when replaced frame was gone... IMAGEFRAME solved issue only temporarily in current session as I couldn't find the way to make it set as saved in drawing and I had to send my *.dwgs... My solution without clipping was at the end good and I did get drawing more simplified without clipping complications and for me and for the person that was revising my *.dwgs...

So in the future try to avoid clipping as much as possible - number of blocks or xrefs don't really affect dwg size so much and it's much easier to compose drawing with small but different xrefs/blocks than with only few ones that are clipped and more difficult to modify and edit...
Title: Re: Hide Frame
Post by: roy_043 on September 02, 2014, 03:54:20 AM
I have to explode the block and set hide frame.
If by frame you mean the outer polyline of the block why not put it on a dedicated layer that can be frozen or switched off?
Title: Re: Hide Frame
Post by: Fabricio28 on September 02, 2014, 11:45:42 AM
I have to explode the block and set hide frame.
If by frame you mean the outer polyline of the block why not put it on a dedicated layer that can be frozen or switched off?

Frame is the polyline outer the 2 images inside the block. Yes!
Title: Re: Hide Frame
Post by: roy_043 on September 03, 2014, 03:42:25 AM
Ah, there are in fact images...
Have you tried regenerating the dwg after changing the imageframe setting?
Title: Re: Hide Frame
Post by: Fabricio28 on September 03, 2014, 06:50:05 AM
Yep my friend,
I have tried that without sucess.

If I set imageframe command after insert the block, work fine.
But inside the code isn't working.
Title: Re: Hide Frame
Post by: roy_043 on September 03, 2014, 07:56:43 AM
How about:
Code: [Select]
(setvar 'imageframe 0)
(command "_.regenall")
Title: Re: Hide Frame
Post by: tedg on September 03, 2014, 12:48:01 PM
How about:
Code: [Select]
(setvar 'imageframe 0)
(command "_.regenall")
To add to this, I've noticed that changing to imageframe = 0 sometimes doesn't "fix it" even with regenall.
What I've had to do is set it to something else first something like:
Code: [Select]
(setvar 'imageframe 2)
(setvar 'imageframe 0)
(command "_.regenall")
Not sure if anyone has this issue, AutoCAD 2013
Title: Re: Hide Frame
Post by: Jeff H on September 03, 2014, 06:33:58 PM
How about:
Code: [Select]
(setvar 'imageframe 0)
(command "_.regenall")
To add to this, I've noticed that changing to imageframe = 0 sometimes doesn't "fix it" even with regenall.
What I've had to do is set it to something else first something like:
Code: [Select]
(setvar 'imageframe 2)
(setvar 'imageframe 0)
(command "_.regenall")
Not sure if anyone has this issue, AutoCAD 2013
+1 even through UI
For 2013 might try FRAME
Quote
Changing the setting for FRAME changes the IMAGEFRAME, DWFFRAME, PDFFRAME, DGNFRAME, XCLIPFRAME, POINTCLOUDCLIPFRAME, and WIPEOUTFRAME settings to the same setting as the new FRAME setting.
Title: Re: Hide Frame
Post by: cmwade77 on September 03, 2014, 07:15:10 PM
How about:
Code: [Select]
(setvar 'imageframe 0)
(command "_.regenall")
To add to this, I've noticed that changing to imageframe = 0 sometimes doesn't "fix it" even with regenall.
What I've had to do is set it to something else first something like:
Code: [Select]
(setvar 'imageframe 2)
(setvar 'imageframe 0)
(command "_.regenall")
Not sure if anyone has this issue, AutoCAD 2013
There is actually a bug in imageframe, if set to 2 or 0 already, you have to change it to something else, then change it back and you have to do this every time you open the drawing. It actually gets really annoying here, hopefully the next version fixes this bug.
Title: Re: Hide Frame
Post by: roy_043 on September 04, 2014, 03:32:24 AM
BricsCAD doesn't have this issue.
How about:
Code: [Select]
(defun SetvarImageframeFix (int) ; Int can be 0, 1 or 2.
  (setvar 'imageframe (rem (1+ int) 3))
  (setvar 'imageframe int)
)
Title: Re: Hide Frame
Post by: Fabricio28 on September 04, 2014, 09:04:28 PM
Thank you very much guys,

I really appreciate the help. I haven't tested the code yet, but as soon as I test I let you know.

Regards
Title: Re: Hide Frame
Post by: Fabricio28 on September 08, 2014, 03:45:16 PM
Hi guys,
I've added that line in my code.
What's wrong with my code?
My block has 2 attributtes, and give a error.

Thank in advance

Code: [Select]
;COMANDOS PARA A INSERÇÃO DE BLOCOS CROQUI
(defun c:CQ nil
(command "_.layer" "_T" "MARGEM" "_M" "MARGEM" "c" "7" "" ""
     "_.layer" "_T" "MARGEM" "_U" "MARGEM" "_M" "MARGEM" "c" "7" "" "")

(command "LAYER" "S" "MARGEM" "" "insert" "MARGEM" pause "" "" "")
(setvar 'imageframe 2)
(setvar 'imageframe 0)
)
Title: Re: Hide Frame
Post by: Fabricio28 on September 10, 2014, 10:40:24 AM
Guys, How Can I turn the frame off in my code?

Title: Re: Hide Frame
Post by: tedg on September 10, 2014, 12:17:54 PM
Guys, How Can I turn the frame off in my code?


did you try regenall after your last imageframe setvar?
Code: [Select]
(setvar 'imageframe 0)
(command "_.regenall")


Title: Re: Hide Frame
Post by: Fabricio28 on September 10, 2014, 12:41:35 PM
Yes Ted,

Code: [Select]
;COMANDOS PARA A INSERÇÃO DE BLOCOS CROQUI
(defun c:CQ ()
(command "_.layer" "_T" "MARGEM" "_M" "MARGEM" "c" "7" "" ""
     "_.layer" "_T" "MARGEM" "_U" "MARGEM" "_M" "MARGEM" "c" "7" "" "")

(command "LAYER" "S" "MARGEM" "" "insert" "MARGEM" pause "" "" "")
(setvar 'imageframe 2)
(setvar 'imageframe 0)
(command "_.regenall")
)

But isn't working
Title: Re: Hide Frame
Post by: Fabricio28 on September 12, 2014, 12:45:36 PM
Accept as solution! :)

I'll open a new threat with the same code. But a different doubt.

Regards