Author Topic: Insert Block from dws file  (Read 1384 times)

0 Members and 1 Guest are viewing this topic.

ROBBO

  • Bull Frog
  • Posts: 217
Insert Block from dws file
« on: April 12, 2016, 05:10:52 AM »
Expert help required.

Can I insert a block from a dws file with a lisp? Or do I need to insert the dws first into the drawing?

Kr. Robbo.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: Insert Block from dws file
« Reply #1 on: April 12, 2016, 05:15:21 AM »

ROBBO

  • Bull Frog
  • Posts: 217
Re: Insert Block from dws file
« Reply #2 on: April 12, 2016, 05:21:28 AM »
http://www.lee-mac.com/steal.html

Thanks HasanCAD.

This is a Lee Mac special I use very often, but wanted an option where I could insert a block from a custom ribbon command.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

ChrisCarlson

  • Guest
Re: Insert Block from dws file
« Reply #3 on: April 12, 2016, 07:48:55 AM »
Of course, setup a custom command and run the following subfunction

Code - Auto/Visual Lisp: [Select]
  1. Examples
  2.  
  3. The following example will attempt to import Layers: 'Layer1' & 'Layer2', and all Dimension Styles beginning with DimStyle from the drawing: 'C:\My Folder\MyDrawing.dwg' into the current drawing.
  4.  
  5. (Steal "C:\\My Folder\\MyDrawing.dwg"
  6.    '(
  7.         (
  8.             "Layers"
  9.             ("Layer1" "Layer2")
  10.         )
  11.         (
  12.             "Dimension Styles"
  13.             ("DimStyle*")
  14.         )
  15.     )
  16. )

ROBBO

  • Bull Frog
  • Posts: 217
Re: Insert Block from dws file
« Reply #4 on: April 12, 2016, 08:46:31 AM »
Thank you ChrisCarlson,

I was trying to make it too difficult for myself.

Code: [Select]
(load "C:\\My Support folder\\StealV1-8.lsp")

(Steal "C:\\My Support folder\\MyStandards.dws"
   '(
         (
            "Blocks"
            ("MyBlock")
        )
    )
)

(COMMAND ".INSERT" "MyBlock" "s" "1")
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

ROBBO

  • Bull Frog
  • Posts: 217
Re: Insert Block from dws file
« Reply #5 on: April 12, 2016, 09:09:39 AM »
I get this error :(

Unable to Interface with drawing: C:\\My Support folder\\MyStandards.dws.INSERT Enter block name or [?] <MYBlock>: MyBlock
"MyBlock.dwg": Can't find file in search path:
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)

ChrisCarlson

  • Guest
Re: Insert Block from dws file
« Reply #6 on: April 12, 2016, 12:58:46 PM »
Is

C:\My Support folder\MyStandards.dws

Listed in your support path?

ROBBO

  • Bull Frog
  • Posts: 217
Re: Insert Block from dws file
« Reply #7 on: April 13, 2016, 02:09:23 AM »
Is

C:\My Support folder\MyStandards.dws

Listed in your support path?

It is.
The only thing to do with good advice is to pass it on.
It is never of any use to oneself.

Oscar Wilde
(1854-1900, Irish playwright, poet and writer)