Need Lisp to insert different blocks at different distances on a pline

Need Lisp to insert different blocks at different distances on a pline

Anonymous
Not applicable
894 Views
8 Replies
Message 1 of 9

Need Lisp to insert different blocks at different distances on a pline

Anonymous
Not applicable

Hello and thanks before hand for the help.

To summarize, I have a csv file with distances from a start point.

What I am looking for is a lisp that asks me for the file and then inserts blocks at the distances depending on the layer.

This layers are basically utilities, water, gas, sewer etc and each have a different block.

Attached is said file. 

Thank you, 

Jorge.

0 Likes
895 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant

Welcome to these Forums!

That doesn't sound difficult, but questions arise....

 

Are the parts after the commas Layer names, or Block names?  In either case, where does the other come from?  That is, if they're Layer names, and each Layer "ha[s] a different block," and a routine is supposed to Insert one of them at that distance and on that Layer, it's easy enough to have it set the Layer, but where would it get the appropriate Block name?  And should all Blocks be at scales of 1 and rotation of 0, or should the rotation align with the direction of the [I'm assuming, since you don't specify] Polyline path at that location?

Kent Cooper, AIA
Message 3 of 9

Anonymous
Not applicable

Hi Kent, thanks for the reply.

The names are layers. I would need the lisp to, depending on the layer, insert a different block at that distance. For example, layer CC_WATER at 18 ft from starting point, then insert the block WATER_PIPE on the CC_WATER layer at 18ft from starting point scale 1 rotation 0. The csv file comes from another lisp that by selecting a base polyline it generates the file with all intersection along that pline, specifying the distance of the insersection from the starting point of the pline and the layer of the line that is intersecting. I hope that is enough information and thanks again for the help.

 

Regards,

Jorge.

0 Likes
Message 4 of 9

devitg
Advisor
Advisor

Hola Jorge , por favor sube el DWG donde quieres aplicar el LISP con el CSV 

 

Please Upload the DWG 

0 Likes
Message 5 of 9

Anonymous
Not applicable

Hola devitg, ahi estan los dos, la idea es que dependiendo de el layer inserte un bloque distinto a la distancia que pone desde un punto base hacia la derecha horizontalmente.

Gracias

0 Likes
Message 6 of 9

devitg
Advisor
Advisor

Hola Jorge , por lo que veo el dwg es de la versión 2004 LT , y en LT NO SE PUEDEN APLICAR LISP , y si se pudiera , porque no es LT , no entiendo la tarea a realizar . 

0 Likes
Message 7 of 9

Anonymous
Not applicable

Hola Devitg, el dwg que envie es de AutoCAD 2018, actualmente utilizo otros LISP. La meta es ta siguiente, que el lisp insete bloques dependiendo de el layer que muestre el cvs file y a la distancia que muestra el archivo tambien. por ejemplo, QUe el lisp pida in punto de inicio el cual yo le doy con un click, a continuacion leer el csv file , ejemplo, 18.534;CC_WATER y con esa informacion introducir el bloque WATER_PIPE a 18.534 pies hacia la derecha de el punto de inicio. 23.853;CC_GAS insertar bloque GAS_PIPE a 23.853 pies hacia la derecha de el punto de inicio... etc. Mi interes es que dependiendo de el layer introduzca un bloque distinto... en dicho layer para que conserve el color de layer necesario.

Gracias

0 Likes
Message 8 of 9

devitg
Advisor
Advisor

De acuerdo, entonces agrega a la tabla csv , qué bloque le corresponde a qué capa. 

 

0 Likes
Message 9 of 9

Anonymous
Not applicable

para facilitar las cosas simplemente voy a cambian los nombres de los bloques a los de los layers. asi puedes considerar que el csv file es una lista de distancias y bloques

0 Likes