Jump to content

Lisp file needing some help.


Recommended Posts

Posted

;;Moves an object in a parallel plane until it is perpendicular of another

;;it then rotates 1st object so that it lines up with it. Similar to

;;align command.

;;Written by Laison Albarado 11-09-2011

(defun c:rm (/ pt1 pt2 pt3 pt4 pt0 ang1 dst1)

(setq os (getvar "OSMODE"))

(setvar "OSMODE" (logior os 1 2 4 32 128 8192))

(setq pt1 (car (entsel "\nSelect 1st object: ")))

(setq dis1 (getdist "\nEnter Distance are select item: "))

(setvar "OSMODE" (logior os 1 2 4 32 128 8192))

(Setq pt3 (getpoint pt1 "\nSelect Reference point/object: "))

(command

"move" pt1 pt2

(setq ang1 (getangle pt1 pt3))

(setq pt4 (polar pt2 ang1 dst1))

(command

"rotate" pt1 pt3

(setvar "osmode" os)

)

)

)

  • Replies 37
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    19

  • Lee Mac

    8

  • laisonalbarado

    8

  • alanjt

    1

Posted

I notice you have posted this in every possible CAD forum, but have failed to answer any questions people are asking. Respond to some questions dude.

Posted
I notice you have posted this in every possible CAD forum, but have failed to answer any questions people are asking. Respond to some questions dude.

 

I guess the OP expects someone will post a fixed code without a reply from him.

 

Any day now, Any day............

Posted
;;Moves an object in a parallel plane until it is perpendicular of another

;;it then rotates 1st object so that it lines up with it. Similar to

;;align command.

;;Written by Laison Albarado 11-09-2011

(defun c:rm (/ pt1 pt2 pt3 pt4 pt0 ang1 dst1)

(setq os (getvar "OSMODE"))

(setvar "OSMODE" (logior os 1 2 4 32 128 8192))

(setq pt1 (car (entsel "\nSelect 1st object: ")))

(setq dis1 (getdist "\nEnter Distance are select item: "))

(setvar "OSMODE" (logior os 1 2 4 32 128 8192))

(Setq pt3 (getpoint pt1 "\nSelect Reference point/object: "))

(command

"move" pt1 pt2

(setq ang1 (getangle pt1 pt3))

(setq pt4 (polar pt2 ang1 dst1))

(command

"rotate" pt1 pt3

(setvar "osmode" os)

)

)

)

 

Have you checked your same thread in Cad Forums that were given to you ?

 

You should reply to your thread to get your codes running the way you desire .

 

Tharwat

Posted

I have ran the code and this is came back:

 

RM

Select 1st object:

Enter Distance are select item: Specify second point:

error: bad argument type: point:

Posted
I have ran the code and this is came back:

 

RM

Select 1st object:

Enter Distance are select item: Specify second point:

error: bad argument type: point:

 

Compare the two codes below, You made changes to the code between forums. Both are different.

You have a problem with the manner in which you are selecting the object. You also made variable changes that are inconsistant within the codes (Using variables in the command calls that are not set before in the program.) And your usage of the command calls with the variable are incorrect. (Another words you are using a variable where you should be using a sub-command.) Also what are you trying to do with osmode by using logior?

 

 

Posted at AUGI

;;Moves and object in a parallel plane of another until it is perpendicular
;;to it then rotates 1st object so that it lines up with it. Similar to 
;;align command.
;;Written by Laison Albarado 11-09-2011 
(defun c:rm (/ pt1 pt2 pt3 pt4 pt0 ang1 dst1)
(setq os (getvar "OSMODE"))
(setvar "OSMODE" (logior os 1 2 4 32 128 8192))
(setq pt1 (getpoint "\nSelect 1st object: ")) 
(setq pt2 (getpoint pt1 "\nEnter second point: "))
(setq pt1 (getdistance "\nEnter Distance are select item: "))
(setvar "OSMODE" (logior os 1 2 4 32 128 8192))
(Setq pt3 (getpoint pt1 "\nSelect Reference point/object: "))
(command
"move" pt1 pt2
(setq ang1 (getangle pt1 pt3))
(setq pt4 (polar pt2 ang1 dst1)) 
(command 
"rotate" pt1 pt3
(setvar "osmode" os)
)
)
)

 

 

Posted on post one here.

;;Moves an object in a parallel plane until it is perpendicular of another 
;;it then rotates 1st object so that it lines up with it. Similar to 
;;align command. 
;;Written by Laison Albarado 11-09-2011 
(defun c:rm (/ pt1 pt2 pt3 pt4 pt0 ang1 dst1)
(setq os (getvar "OSMODE"))
(setvar "OSMODE" (logior os 1 2 4 32 128 8192))
(setq pt1 (car (entsel "\nSelect 1st object: ")))
(setq dis1 (getdist "\nEnter Distance are select item: "))
(setvar "OSMODE" (logior os 1 2 4 32 128 8192))
(Setq pt3 (getpoint pt1 "\nSelect Reference point/object: "))
(command
"move" pt1 pt2
(setq ang1 (getangle pt1 pt3))
(setq pt4 (polar pt2 ang1 dst1)) 
(command 
"rotate" pt1 pt3
(setvar "osmode" os)
)
)
) 

Posted

Well "Buzzard" what you are saying it's messed up. LOL

 

 

Anyway, this my first try at writing code. I never it before. Yes I have different forums. I think the more the exposure the better chance of me getting the help that I need.

 

The line the has the "logior" in it. I had put out a question not that long ago, "When writing code and you get to where you are going to set you OSMODE setting can you set more than 1 setting in the same line"?

 

I want it basically to use to pick my source's item (the item that I want moved) either endpoint, midpoint, center or intersection depending on what I am moving.

 

 

I got this back:

 

(setq os (getvar "OSMODE"))
(setvar "OSMODE" (logior os 1 2 4 32))

 

A buddy of mine gave me this part:

 

(setvar "osmode" os)

Posted
The line the has the "logior" in it. I had put out a question not that long ago, "When writing code and you get to where you are going to set you OSMODE setting can you set more than 1 setting in the same line"?

 

Logior is the best way to deal with the OSMODE setting, as it is a bit-coded value and you are effectively flipping the bits that aren't set, at the same time leaving those that are:

 

Explanation here:

 

http://www.cadtutor.net/forum/showthread.php?43975-Order-of-function&p=298061#post298061

 

Or similar, regarding boole:

http://www.cadtutor.net/forum/showpost.php?p=306339&postcount=9

 

 

I assume you also refer to this thread:

http://www.theswamp.org/index.php?topic=35639.0

Posted (edited)
Well "Buzzard" what you are saying it's messed up. LOL

 

 

Anyway, this my first try at writing code. I never it before. Yes I have different forums. I think the more the exposure the better chance of me getting the help that I need.

 

The line the has the "logior" in it. I had put out a question not that long ago, "When writing code and you get to where you are going to set you OSMODE setting can you set more than 1 setting in the same line"?

 

I want it basically to use to pick my source's item (the item that I want moved) either endpoint, midpoint, center or intersection depending on what I am moving.

 

 

I got this back:

 

(setq os (getvar "OSMODE"))
(setvar "OSMODE" (logior os 1 2 4 32))

 

A buddy of mine gave me this part:

 

(setvar "osmode" os)

 

OSMODE

 

Type: Integer

Saved in: Registry

Initial value: 4133

 

Sets running Object Snap modes using the following bitcodes:

 

0 NONe

1 ENDpoint

2 MIDpoint

4 CENter

8 NODe

16 QUAdrant

32 INTersection

64 INSertion

128 PERpendicular

256 TANgent

512 NEArest

1024 QUIck

2048 APParent Intersection

4096 EXTension

8192 PARallel

 

To specify more than one object snap, enter the sum of their values. For example, entering 3 specifies the Endpoint (bitcode 1) and Midpoint (bitcode 2) object snaps. Entering 16383 specifies all object snaps.

 

When object snaps are switched off using the Osnap button on the status bar, a bitcode of 16384 (0x4000) is returned, in addition to the normal value of OSMODE. With this additional value, developers can write applications for AutoCAD, and distinguish this mode from Object Snap modes that have been turned off from within the Drafting Settings dialog box. Setting this bit toggles running object snaps off. Setting OSMODE to a value with this bit off toggles running object snaps on.

 

 

I am not trying to be critical, It does seem randomly cut and pasted. Here is a good place to learn for beginners : http://www.afralisp.net/index.php

 

 

Logior is the best way to deal with the OSMODE setting, as it is a bit-coded value and you are effectively flipping the bits that aren't set, at the same time leaving those that are:

 

Explanation here:

 

http://www.cadtutor.net/forum/showthread.php?43975-Order-of-function&p=298061#post298061

 

Or similar, regarding boole:

http://www.cadtutor.net/forum/showpost.php?p=306339&postcount=9

 

 

I assume you also refer to this thread:

http://www.theswamp.org/index.php?topic=35639.0

 

Lee,

 

Thats the first time I seen that, Although I guess its pretty neat, But it looks like overkill for what is being accomplished in this case. You can still combine the right number of integer values to accomplish the same.

Edited by The Buzzard
Posted
Thats the first time I seen that, Although I guess its pretty neat, But it looks like overkill for what is being accomplished in this case. You can still combine the right number of integer values to accomplish the same.

 

Definitely not overkill - think about how you might perform the same task (that is, switching extra OSnaps on whilst leaving what is already on) without using bit manipulation...

 

Furthermore, you have a lot more control over the value when using these tools, (see my example of creating a toggle for instance) - and it makes sense to control a bit-coded value using functions designed to manipulate such values.

 

Lee

Posted
Definitely not overkill - think about how you might perform the same task (that is, switching extra OSnaps on whilst leaving what is already on) without using bit manipulation...

 

Furthermore, you have a lot more control over the value when using these tools, (see my example of creating a toggle for instance) - and it makes sense to control a bit-coded value using functions designed to manipulate such values.

 

Lee

 

I saw those great examples and I will not argue with that, But in laison case in his code above, He is not using it the same way as in your toggle example.

Posted (edited)
I saw those great examples and I will not argue with that, But in laison case in his code above, He is not using it the same way as in your toggle example.

 

Thanks -

 

But the way I interpret Laison's code is that he wants to enable those snaps (1 2 4 32 128 8192) in addition to the current OSnap setting, I'm intrigued as to a better way to approach this other than logior.

 

Aside - I'm not saying Laison's code is correct in its entirety, but I am curious of a better way to code the OSnap part, if my understanding of its purpose is correct.

 

EDIT: Quickly penned this function which, I hope, performs the same operation, but without the use of a bit-wise inclusive OR function (such as logior) - just for a comparison.

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] [color=black]_SnapSetting[/color] [b][color=RED]([/color][/b] n [b][color=BLUE]/[/color][/b] _GetBits [color=black]os [/color][b][color=RED])[/color][/b]

 [i][color=#990099];; This is not a practical example in[/color][/i]
 [i][color=#990099];; any way, as the easiest way to accomplish[/color][/i]
 [i][color=#990099];; this task would be to IOR the existing[/color][/i]
 [i][color=#990099];; snap value with that which is desired -[/color][/i]
 [i][color=#990099];; however, I am trying to demonstrate a possible[/color][/i]
 [i][color=#990099];; method to accomplish the same operation *without*[/color][/i]
 [i][color=#990099];; the use of bit-wise inclusive OR function.[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] _GetBits [b][color=RED]([/color][/b] x [b][color=RED])[/color][/b]

   [i][color=#990099];; This function returns a list of all the bits[/color][/i]
   [i][color=#990099];; that make up a bit coded value 'x'.[/color][/i]

   [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] _GetBits [b][color=RED]([/color][/b] x i [b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]<[/color][/b] [b][color=#009900]0[/color][/b] x[b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]logand[/color][/b] x i[b][color=RED]))[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] i [b][color=RED]([/color][/b]_GetBits [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] x i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]lsh[/color][/b] i [b][color=#009900]1[/color][/b][b][color=RED])))[/color][/b]
         [b][color=RED]([/color][/b]_GetBits x [b][color=RED]([/color][/b][b][color=BLUE]lsh[/color][/b] i [b][color=#009900]1[/color][/b][b][color=RED]))[/color][/b]
       [b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
   [b][color=RED])[/color][/b]

   [b][color=RED]([/color][/b]_GetBits x [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]

 [i][color=#990099];; Split n into its constituent bits and get the current[/color][/i]
 [i][color=#990099];; OSMODE value for comparison.[/color][/i]
 
 [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] n [b][color=RED]([/color][/b]_GetBits n[b][color=RED])[/color][/b] [color=black]os [/color][b][color=RED]([/color][/b][b][color=BLUE]getvar[/color][/b] [b][color=DARKRED]'[/color][/b]OSMODE[b][color=RED]))[/color][/b]

 [i][color=#990099];; Now we do the operation that a bit-wise inclusive[/color][/i]
 [i][color=#990099];; OR would do in one step: If the bits constituting[/color][/i]
 [i][color=#990099];; our value 'n' do not appear in the current OSMODE[/color][/i]
 [i][color=#990099];; value, then add them to it.[/color][/i]
 
 [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] bit n
   [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]logand[/color][/b] bit [color=black]os[/color][b][color=RED]))[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] [color=black]os[/color] [b][color=RED]([/color][/b][b][color=BLUE]+[/color][/b] [color=black]os [/color]bit[b][color=RED]))[/color][/b]
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]

 [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=DARKRED]'[/color][/b]OSMODE [color=black]os[/color][b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

Edited by Lee Mac
Posted
Thanks -

 

But the way I interpret Laison's code is that he wants to enable those snaps (1 2 4 32 128 8192) in addition to the current OSnap setting, I'm intrigued as to a better way to approach this other than logior.

 

Aside - I'm not saying Laison's code is correct in its entirety, but I am curious of a better way to code the OSnap part, if my understanding of its purpose is correct.

 

EDIT: Quickly penned this function which, I hope, performs the same operation, but without the use of a bit-wise inclusive OR function (such as logior).

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] [color=black]_SnapSetting[/color] [b][color=RED]([/color][/b] n [b][color=BLUE]/[/color][/b] _GetBits [color=black]os [/color][b][color=RED])[/color][/b]

[i][color=#990099];; This is not a practical example in[/color][/i]
[i][color=#990099];; any way, as the easiest way to accomplish[/color][/i]
[i][color=#990099];; this task would be to IOR the existing[/color][/i]
[i][color=#990099];; snap value with that which is desired -[/color][/i]
[i][color=#990099];; however, I am trying to demonstrate a possible[/color][/i]
[i][color=#990099];; method to accomplish the same operation *without*[/color][/i]
[i][color=#990099];; the use of bit-wise inclusive OR function.[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] _GetBits [b][color=RED]([/color][/b] x [b][color=RED])[/color][/b]

[i][color=#990099];; This function returns a list of all the bits[/color][/i]
[i][color=#990099];; that make up a bit coded value 'x'.[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] _GetBits [b][color=RED]([/color][/b] x i [b][color=RED])[/color][/b]
[b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]<[/color][/b] [b][color=#009900]0[/color][/b] x[b][color=RED])[/color][/b]
[b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] i [b][color=RED]([/color][/b][b][color=BLUE]logand[/color][/b] x i[b][color=RED]))[/color][/b]
[b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] i [b][color=RED]([/color][/b]_GetBits [b][color=RED]([/color][/b][b][color=BLUE]-[/color][/b] x i[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]lsh[/color][/b] i [b][color=#009900]1[/color][/b][b][color=RED])))[/color][/b]
[b][color=RED]([/color][/b]_GetBits x [b][color=RED]([/color][/b][b][color=BLUE]lsh[/color][/b] i [b][color=#009900]1[/color][/b][b][color=RED]))[/color][/b]
[b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b]_GetBits x [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[i][color=#990099];; Split n into its constituent bits and get the current[/color][/i]
[i][color=#990099];; OSMODE value for comparison.[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] n [b][color=RED]([/color][/b]_GetBits n[b][color=RED])[/color][/b] [color=black]os [/color][b][color=RED]([/color][/b][b][color=BLUE]getvar[/color][/b] [b][color=DARKRED]'[/color][/b]OSMODE[b][color=RED]))[/color][/b]

[i][color=#990099];; Now we do the operation that a bit-wise inclusive[/color][/i]
[i][color=#990099];; OR would do in one step: If the bits constituting[/color][/i]
[i][color=#990099];; our value 'n' do not appear in the current OSMODE[/color][/i]
[i][color=#990099];; value, then add them to it.[/color][/i]

[b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] bit n
[b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]zerop[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]logand[/color][/b] bit [color=black]os[/color][b][color=RED]))[/color][/b]
[b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] [b][color=BLUE]os[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]+[/color][/b] [color=black]os [/color]bit[b][color=RED]))[/color][/b]
[b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=DARKRED]'[/color][/b]OSMODE [color=black]os[/color][b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

 

Ok, I see where your going with this now. It was his intent that you saw. When I looked up logior, The examples that autodesk provides are limited in explaination. So I did not see it quite the same way, But I get it now.

 

Thanks

Posted
It was his intent that you saw.

 

Well, at least I hope I got it right... in any case, I hope this thread might be useful to others' understanding of the topic.

 

When I looked up logior, The examples that autodesk provides are limited in explaination. So I did not see it quite the same way, But I get it now.

 

True, in my opinion, the best way to visualise it is in binary - so using those tables I provided in a previous link. The help on the boole function is slightly better in this respect. I'm glad I could help with your understanding :)

Posted

Looking back on it, a more common example of the use of such functions is in manipulating layers in Vanilla - i.e. freezing/thawing/locking/unlocking etc.

 

Think about how you might freeze a layer by changing (entmod) the layer table object (tblobjname), without changing whether it is locked/unlocked or perhaps frozen in viewports etc.

 

Here are a few examples:

 

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] BitToggle [b][color=RED]([/color][/b] bit value flag [b][color=RED])[/color][/b]

 [i][color=#990099];; Function to include/exclude bit from[/color][/i]
 [i][color=#990099];; value, depending upon flag.[/color][/i]
 [i][color=#990099];; flag=1 include, flag=0 exclude.[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]boole[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]+[/color][/b] [b][color=#009900]4[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]*[/color][/b] flag [b][color=#009900]3[/color][/b][b][color=RED]))[/color][/b] bit value[b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] FreezeThawLayer [b][color=RED]([/color][/b] layer flag [b][color=BLUE]/[/color][/b] [color=black]elist [/color][b][color=RED])[/color][/b]

 [i][color=#990099];; layer: name of layer (string)[/color][/i]
 [i][color=#990099];; flag=1 freeze, flag=0 thaw[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] layer [b][color=RED]([/color][/b][b][color=BLUE]tblobjname[/color][/b] [b][color=#a52a2a]"LAYER"[/color][/b] layer[b][color=RED]))[/color][/b]
   [b][color=RED]([/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b] dxf [b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]entmod[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]subst[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]70[/color][/b] [b][color=RED]([/color][/b]BitToggle [b][color=#009900]1[/color][/b] dxf flag[b][color=RED]))[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]70[/color][/b] [color=black]elist[/color][b][color=RED])[/color][/b] [color=black]elist[/color]
         [b][color=RED])[/color][/b]
       [b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]70[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] [color=black]elist [/color][b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] layer[b][color=RED]))))[/color][/b]
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

[b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] LockUnlockLayer [b][color=RED]([/color][/b] layer flag [b][color=BLUE]/[/color][/b] [color=black]elist [/color][b][color=RED])[/color][/b]

 [i][color=#990099];; layer: name of layer (string)[/color][/i]
 [i][color=#990099];; flag=1 lock, flag=0 unlock[/color][/i]

 [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] layer [b][color=RED]([/color][/b][b][color=BLUE]tblobjname[/color][/b] [b][color=#a52a2a]"LAYER"[/color][/b] layer[b][color=RED]))[/color][/b]
   [b][color=RED]([/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]lambda[/color][/b] [b][color=RED]([/color][/b] dxf [b][color=RED])[/color][/b]
       [b][color=RED]([/color][/b][b][color=BLUE]entmod[/color][/b]
         [b][color=RED]([/color][/b][b][color=BLUE]subst[/color][/b]
           [b][color=RED]([/color][/b][b][color=BLUE]cons[/color][/b] [b][color=#009900]70[/color][/b] [b][color=RED]([/color][/b]BitToggle [b][color=#009900]4[/color][/b] dxf flag[b][color=RED]))[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]70[/color][/b] [color=black]elist[/color][b][color=RED])[/color][/b] [color=black]elist[/color]
         [b][color=RED])[/color][/b]
       [b][color=RED])[/color][/b]
     [b][color=RED])[/color][/b]
     [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=#009900]70[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] [color=black]elist [/color][b][color=RED]([/color][/b][b][color=BLUE]entget[/color][/b] layer[b][color=RED]))))[/color][/b]
   [b][color=RED])[/color][/b]
 [b][color=RED])[/color][/b]
[b][color=RED])[/color][/b]

Posted

I am looking at your post about the osmode setting and using logior. My goal was to use just these settings.

 

Apparently if I am correct I must turn off my osnaps than set the osmode setting. Also, when I set the osmode setting, if I am going to use more than 1 I should add them up.

 

Is this what I getting from the posts?

Posted
My goal was to use just these settings.

 

Judging from your original post, the code you are currently using is setting those OSMODE settings in addition to those already set.

 

To set just those settings, you could store the current setting, then overwrite it with the settings you want, i.e.:

 

(setq os (getvar 'OSMODE))

(setvar 'OSMODE (+ 1 2 4 32 128 8192))

Then restore the old setting at the end of the code (and in the error handler):

 

(setvar 'OSMODE os)

 

As an aside, (boole 5 os (+ 1 2 4 32 128 8192)) would give the same result.

Posted

I guess I was not off the mark afterall.

 

(setq os (getvar "OSMODE")) ;Save User Object Snaps

 

(setvar "OSMODE" Your new setting here) ; Add-on to your orginal object snap setting

 

(setvar "OSMODE" os) ;Restore your Saved User Object Snaps

Posted

In any case, I have enjoyed the deviation in this thread, and I hope my earlier posts aren't wasted.

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