Once in past, I had a problem how to offset in 3d, but my problem was with 3dpolyline object, and I wrote this code...
(defun c:3doffset-3dpoly ( / ent entA entcoordlst pt3d pt2d entvertlst3d entvertlst2d pto d 2dplo 2dpln 2dplncoordlst 2dplnvertlst3d ptx pty ptz ptxlst ptylst ptzlst 3dplnvertlst3d )
(setq oscmd (getvar 'osmode))
(setvar 'osmode 0)
(setq ent (car (entsel "\nSelect 3D Polyline - 3dpline must not have vertical segments")))
(vl-load-com)
(setq entA (vlax-ename->vla-object ent))
(setq entcoordlst (vlax-safearray->list (vlax-variant-value (vla-get-Coordinates entA))))
(repeat (/ (length entcoordlst) 3)
(setq pt3d (list (car entcoordlst) (cadr entcoordlst) (caddr entcoordlst)))
(setq pt2d (list (car entcoordlst) (cadr entcoordlst) 0 ))
(repeat 3
(setq entcoordlst (cdr entcoordlst))
)
(setq entvertlst3d (cons pt3d entvertlst3d))
(setq entvertlst2d (cons pt2d entvertlst2d))
)
(setq entvertlst3d (reverse entvertlst3d))
(setq entvertlst2d (reverse entvertlst2d))
(command "pline")
(foreach pt entvertlst2d (command pt))
(command "")
(command "ucs" "w")
(command "plan" "")
(setq pto (getpoint "\nPick point for side for 3doffset (in/out) : "))
(setq pto (list (car pto) (cadr pto) 0))
(setq d (getdist "\nInput horizontal distance for 3doffset (2 points) : "))
(setq 2dplo (entlast))
(command "offset" d (entlast) pto "")
(entdel 2dplo)
(setq 2dpln (entlast))
(setq 2dplnA (vlax-ename->vla-object 2dpln))
(setq 2dplncoordlst (vlax-safearray->list (vlax-variant-value (vla-get-Coordinates 2dplnA))))
(repeat (/ (length 2dplncoordlst) 2)
(setq pt3d (list (car 2dplncoordlst) (cadr 2dplncoordlst) 0 ))
(repeat 2
(setq 2dplncoordlst (cdr 2dplncoordlst))
)
(setq 2dplnvertlst3d (cons pt3d 2dplnvertlst3d))
)
(setq 2dplnvertlst3d (reverse 2dplnvertlst3d))
(entdel 2dpln)
(repeat (length 2dplnvertlst3d)
(setq ptx (car (car 2dplnvertlst3d)))
(setq pty (cadr (car 2dplnvertlst3d)))
(setq 2dplnvertlst3d (cdr 2dplnvertlst3d))
(setq ptxlst (cons ptx ptxlst))
(setq ptylst (cons pty ptylst))
)
(setq ptxlst (reverse ptxlst))
(setq ptylst (reverse ptylst))
(repeat (length entvertlst3d)
(setq ptz (caddr (car entvertlst3d)))
(setq entvertlst3d (cdr entvertlst3d))
(setq ptzlst (cons ptz ptzlst))
)
(setq ptzlst (reverse ptzlst))
(repeat (length ptzlst)
(setq ptn (list (car ptxlst) (car ptylst) (car ptzlst)))
(setq ptxlst (cdr ptxlst))
(setq ptylst (cdr ptylst))
(setq ptzlst (cdr ptzlst))
(setq 3dplnvertlst3d (cons ptn 3dplnvertlst3d))
)
(setq 3dplnvertlst3d (reverse 3dplnvertlst3d))
(command "3dpoly")
(foreach pt 3dplnvertlst3d (command pt))
(command "")
(setvar 'osmode oscmd)
(princ)
)
If you have LWPOLYLINE like in your case, you can just use ordinary offset command, or if you have LINE object, you can use copy command and make copy of it in 3d space... Note that ordinary offset command works only in 2d and some relative UCS, so if you want 3d you'll probably need to make object in UCS where you want to make offset copy of that object... Like ordinary offset, my 3doffset also does offset, but in WCS - asks for horizontal distance between old and new 3dpoly, however with mine as all 3dpoly vertexes are in 3d, resulting 3dpoly is also in 3d... Maybe what I just explained is enough for you to complete the job without unnecessary questions that may rise up ab this problem... I agree with Irne - we don't know what should 3doffset quite do - if not the same as copy command...
M.R.