Roderic Potter
Usenet Archive
- Joined
- Jan 23, 2004
- Messages
- 20
- Reaction score
- 0
With the help of some brilliant members of this newsgroup I have managed to write some code that allows me to automatically ascertain the layer of an existing entity just by picking somewhere on it.
Example:
I have a line representing a pipe, and the line resides on layer H-SM-PIP-P, for "mechanical schematic piping planned" (Canadian PWGSC layer standard). I want to insert a block on this line to represent an "elbow" in the pipe, and I want this block to automatically jump to the related H-SM-PIP-FTG-P layer, for "fittings".
I normally used to make sure the piping layer was current, then insert the block, and my existing code flipped the block to the right layer after insertion.
My new code now allows me to do all of this automatically without having to set the particular layer current first, because when I osnap onto the line, the pick function reveals what layer the pipe line is on, thus revealing to the code what the associated layer is.
This works brilliantly under normal circumstances, UNTIL I am not zoomed in far enough.
If I try this from too far out (zoom-wise), and osnap endpoint onto the line, AutoCad does not find the line - in fact it finds NOTHING and thinks the layer of the entity is layer ZERO.
This is not cricket as they say.
Is there a setting somewhere in AutoCad that will alter its ability to look deep inside a pick?
regards
Example:
I have a line representing a pipe, and the line resides on layer H-SM-PIP-P, for "mechanical schematic piping planned" (Canadian PWGSC layer standard). I want to insert a block on this line to represent an "elbow" in the pipe, and I want this block to automatically jump to the related H-SM-PIP-FTG-P layer, for "fittings".
I normally used to make sure the piping layer was current, then insert the block, and my existing code flipped the block to the right layer after insertion.
My new code now allows me to do all of this automatically without having to set the particular layer current first, because when I osnap onto the line, the pick function reveals what layer the pipe line is on, thus revealing to the code what the associated layer is.
This works brilliantly under normal circumstances, UNTIL I am not zoomed in far enough.
If I try this from too far out (zoom-wise), and osnap endpoint onto the line, AutoCad does not find the line - in fact it finds NOTHING and thinks the layer of the entity is layer ZERO.
This is not cricket as they say.
Is there a setting somewhere in AutoCad that will alter its ability to look deep inside a pick?
regards